yep, Laura has it right. TIME, TIME , TIME.

This is a paraphrase of famous high altitude physician Peter Hackett who wrote about bad AMS/HAPE/HACE preferred Rx as DESCENT, DESCENT, DESCENT.

Diamox, avoiding strenuous activity, avoiding alcohol (and other drugs), getting good sleep, hydration, etc are all ideas that help, but some people are just plain slow-acclimatizers and need TIME, no matter what. Some have a low ceiling that will not let them get over while others blast on through. Some just never acclimatize at all and give up, or just do not allow enough time.

Only experience by the individual will answer the question. While AMS is said to be sporadic and unpredictable, much of that rule is about HAPE and not so much simple AMS. Some people do learn from repeated exposure that they are just the way they are and it cannot be changed. They learn what they gotta do and do it right when they return.

My mentor said:
The practice of (high altitude or other) medicine is an unending series of arbitrary decisions based on intuition and inadequate facts.