It depends on the form of magnesium, e.g. some forms are not bio-available such as mag oxide, while others seem more suited to the individual. Two brands that work well are Doctor's Best High Absorption magnesium and UltraMag from Source Naturals. Magnesium also need co-nutrients as well, for instance Vitamin B6 and Vitamin D. Calcium can be antagonistic which means it can interfere with mag utilization.
There is a possibility that the infection could be partly in the liver, e. histolytica is a protozoa which can inhabit the liver. Another possibility is liver flukes and I would suppose that many bacteria could be in there as well.