I take medicine in the mornings that upsets my stomach if I don’t take it with food. When I go to Daily Mass, I end up eating breakfast and finishing up right at 5:30a or so, give or take a few. I try to at least eat light, maybe a piece of toast with water, so that I am only eating what I need to eat so that I don’t start to get queasy in the middle of Mass because my meds are kicking in. I think that as long as you don’t have the attitude of, “Well, I have to eat with my meds, I have to take my meds at 11:30a, I have Mass at Noon, guess it’s okay to go to have that burger and fries with a shake right before Mass so I can take my meds!”
The idea behind the fast is the graces given by mortification that makes one more receptive to the graces given through communion with Christ. If you have to take medicine within an hour of Mass and you have to take it with food, maybe take it with a piece of dry toast and water, or with a small bowl of plain rice, or oatmeal with no sugar or milk - something that will help the medicine to set well in your stomach, but is still a very simple and penitential type meal.
You should probably talk to your confessor to make absolutely sure you are taking the actions that are most pleasing to God and most appropriate for your state in life.