First of all you are not fasting. You are just eating partially. A roadway to starvation. Also your body robs the nutrients it needs from the reserves, bones and muscle. You are practicing very enervating lifestyle, coffee, nicotine gum, etc.
Person with IBS should not take magnesium.
There is no such thing as constipation run in the family, it is everyone in the family is eating foods that clog up their colon.
Sorry to be harsh. If you want to help yourself just fast with water only, this way body will use all its energy to heal itself and balance where ever needed. If you don’t eat then don’t worry about pooping.
I will send you more information later. But you need to stop hurting your body by eating wrong things.