I wouldnt risk fasting and taking medication at the same time. Sometimes it won't say on the packet that you shouldnt fast while taking it but if you look on the internet it will say it is dangerous, etc to take it while not eating a normal diet.
I would risk fasting without the medication possibly but I don't know anything about your condition so can't help, would need to do some reading about it.