Question:
Is it permitted to take caffeine supplements by mouth on Tisha Bav? Yom Kippur? What are the guidelines for each?
Answer:
I am assuming that you are not taking them because of any specific medical condition, that it is medically needed. regarding Tisha B'av, it is permitted to take the caffeine pills without water on Tisha B'av.
Regarding Yom Kippur they should not be taken unless the person is sick, and considered a choleh sain bo sakana. The reason is since we are not allowed to take medications on Yom Kippur, similar to not taking medications on Shabbos. The poskim consider caffeine pills to be a form of medication. Please see the following post https://dinonline.org/2017/01/15/are-caffeine-pills-considered-medicine-on-shabbos/
Sources:
Beer Hetiv 567-7, Kaf Hachaim 564-34, Shulchan Shlomo 321-23, Sefer Refuas Yisroel pg. 36.