AMS IMO is 50/50 you can prepare by trying to acclimate a couple of days before. Obtain prescription pills.
I was fortunate and didn't suffer from AMS during my hike. I didn't acclimate or have prescription bills. A group of hikers I met the day of the hike obtained prescriptions pills and suffered from AMS.