Is one allowed to take a pill on Shabbos to help making the fast easier on Sunday?
It is best to mix up the content of the pill with food (before Shabbos), and this can be eaten on Shabbos.
If this was not done, there is room for leniency in taking the pill on Shabbos, but this should only be done if a person feels the fast will be very hard for him without the pill.
The question of taking a pill on Shabbos is disputed among contemporary authorities.
Although some are cited as being stringent in this matter, both because of taking medicine on Shabbos, and because of hachanah (preparation for weekdays; see Maadanei Yom Tov, Vol. 4, siman 145, citing from Rav Elyashiv and others), Rabbi Pesach Eliyahu Falk (Kol Torah 61, p. 51) writes at length that it is permitted, explaining that both concerns do not apply (one the one hand, this is not called medicine; on the other, it is not hachanah, because it only means to save a person from feeling ill and weak, and not to grant something positive).
Therefore, it is better to be stringent, and to mix in the pill’s content with food, in which case it is certainly permitted. If this is not possible, one can be lenient.