If I did that, can I make it up with paying money to the poor instead? Or do I have to fast again? Is it okay to break the fast for medicine for my OCD?
You are only obligated to fast if you are physically able to do so. For example diabetics are not obligated to fast as it would be physically harmful to them. If you are taking medication, sick, traveling, etc. you can make up for your fast after Ramadan.
This Ramadan I had to go to the hospital and they withdrew blood - so my fast was invalidated. This fast I have to make up for after Ramadan; similarly if you need to take medicine or God forbid you are sick and need emergency treatment, you can make up the fast after Ramadan (you can't, however; pay money or feed the needy for this).
If you feel as if you broke your fast, then you have to make it up and can't feed people in replace of it as it was suppose to be done right away.
Some scholars have said feeding people is only for those who have reached old age. They use the sayings of ibn Masud and actions of Anas bin Mailk as interpretation.
And some have said it can be for anyone who is ill, traveling, and isn't able to fast. However it was suppose to be done right away.
A person who must observe the fast (on Ramadhan) and has the complete conditions of it (to observe the fasting), in case that he doesn't do it (fasting) or breaks his fasting before its specific time (قبل الافطار): he must pay Kaffarah (کفاره) as well as the Qazaa of that fasting.
(Notice: this issue which I mentioned above, is related to the fasting of Ramadhan as a Wajib Fasting).
Kafarah or expiation is related to one of the following items (you ought to do one of items below):
1: fasting (60 days) (that 31 days of this ought to be consecutive)
2: to set at liberty or to free a slave
3: for each day, giving food to 60 poor people ….
In regard to taking pills, on the whole, it will make the fasting invalid . then you ought not to eat pills.
(Of course if leaving the taking of the mentioned pill would create a crucial difficulty for your body, then it has another ruling …), not every pill.