Amphetamine can make you overheat & leave you feeling worse afterwards.
Cocaine seems worse.
A bit of weed can work well in (or before) a rave, it'll make the MDMA & music more intense without making you jittery. Might get more floored off the comeup from a large MDMA dose, but then it's good. Helps stop any nausea too.
Smaller amounts of caffeine can give more energy without the palpitations & anxiety, but you need to be careful with it. Tea is always good, or some mildly caffeinated soft drink like coke.
Alcohol will make it worse & dull the stimulant effects, so if you're drinking alcohol when you're going out then cut it down to just 1 or 2 small drinks, or no alcohol.
Make sure you're not dehydrated, hungry or lacking salt. It can be harder to eat, but small snacks can help a lot, have some salted peanuts or sweets or any kind of snack you can get while you're out. Don't have a huge meal so that you're drowsy from eating too much & can't absorb the pill, but eat well before you go out. Drink enough water, if you're dancing & sweating a lot you might need as much as 500ml an hour (and salt too, if you're drinking/sweating that much).
Have a sleep before you go out.
You could try healthier living too, at least when you're not out raving, naturally get more energy through eating healthily & staying active. If you want to dance for hours you need more than just drugs, train to improve your stamina.
Part of it is a tolerance thing too, 'losing the magic', if you take MDMA less often & not in reckless doses then you'll have a better time when you take it.