These chemicals, known as neurotransmitters are the messenger carriers of the brain and effect everything from well being to appetite, movement and thought. It is the stimulation of the drug which causes more or less of these chemicals to be present, with the body often having to produce more of the neurotransmitter, in response to the action of the drug. This leads to depleting the building blocks of these chemicals, namely the essential amino acids and vitamins. Ecstasy or MDMA by way of it's action decreases the level of the amino acid tryptophan, used to make 5HT, the neurotransmitter primarily stimulated by this drug. Tryptophan, while no longer available over the counter as a supplement, is however contained in many foods.
Bananas are one of the best sources as are milk and other dairy foods.
This can also help with alcohol, as this drug also depletes this and other amino acids. MDMA and similar drugs also use up calcium from the action on neurons. Calcium acts like a battery for these cells, so if you turn them on harder you can expect to use more calcium. Jaw grinding becomes much worse if Calcium levels are depleted. Milk again is a good source of calcium.