Not really an expert on this but if this were the case for me, I'd first start from the point of drinking a large electrolyte drink with my one daily meal. I'd avoid it during fasting period, but I would definitely try out if it works for me by taking more of it in during the meal and just increase it or decrease it depending on the effect it is having on me during night time in terms of whether or not my leg cramps are decreasing.