Poorly framed question imo.
I assume by equal dose, you mean equal "intensity of use", since it otherwise becomes a question of how large the dosage is.
Coke is phsically nasty, particularly so. Also, it's a drug people often use quite frequently (also true of weed, and to a lesser extent booze), while MDMA is absolutely not a drug that can be taken frequently and still enjoyed.
Overall... I would say Coke worse than MDMA worse than alcohol worse than weed.
1. It's a stimulant, with all the associated sideffects from a strong stimulant. Additionally, it is particularly bad for the heart, because as a local anesthetic, it reduces electrical conductivity - well, bad news, guess how the heartbeat is handled? Electrical impulses. That's why long term users of cocaine often eventually die of cardiac arrest or heart attack, far before their time.
2. MDMA is problematic for different reasons, as it causes terrible comedowns (days of depression) for some users, particularly ones who've used it frequently. It is somewhat neurotoxic, damaging the serotonin system. Also, using it more often than every few months, most users will "lose the magic" and stop enjoying it - you cannot use and enjoy MDMA as often as one can use coke. However, physically, it's not that bad.
3. MJ has few sideeffects, and is not particularly harmful. Heavy users long term (years) sometimes find that it starts causing them anxiety.
4. Drinking is not particularly healthy, but it's not all that bad. Heavy use will produce physical dependence (unlike coke, MJ, or MDMA). And of course we're all familiar with hangovers....
5. Hard to predict, but i think he's end up alot worse off than smoking MJ, as he'd be psychologically dependent on coke, and would probably have trouble enjoying life for a while without coke, and he might also experience warning signs of heart problems (palpitations and the like).
The susceptability to sideeffects from different substances vary very widely between people. Some get horrible horrible depression after MDMA, others can abuse E (ie, use it very often) for a year and still enjoy it. Some people will get unpleasant effects from coke, others wont.
Also, single overdoses can magnify the damage with any drug - MDMA overdoses result in more severe depression afterwards, there's a guy who posted here about swallowing a bag of coke when they got pulled over, and having ti break open inside their stomach and going into convulsions, and afterwards they got chest pains if they took any coke, single bad experiences with weed can cause anxiety when smoking afterwards, etcetera.