Everyone is different, but I used to get cramps BAD. Usually when going to bed after riding hard. I tried taking supplements as I guessed I was deficient in potassium. I ended up with kidney stones. Not sure if this was the cause as I didnt have them analyzed. But I never got them again after limiting my recovery drinks, and stopping with the added pills for cramps.
Anyway, for me hydration helped a bunch. I weighed myself before and after my rides and was losing an average of 2 lbs per ride in water. So I decided to start hydrating all day. Things have gotten way better for me.