Father Laux makes clear in his book Mass and the Sacraments that such a situation, even if a small amount of water (or, I assume, toothpaste) is ingested, that such things are not in the nature of food.
St. Thomas uses the expression
per modum cibi, "in the manner of food". If a bit of toothpaste or mouthwash goes down your throat, is that basically the same thing as sitting down and eating a meal? You did not ingest the water or toothpaste for food or nutrition.
Perhaps a simpler way to put it is whether you could properly use the very "eat". Did you eat some toothpaste? Or did you merely ingest it? Nobody would ever say that they ate toothpaste (well, except for someone who has pica or something and likes actually eating it). Did you eat a candy bar? Yes. Did you eat the mouthwash? No. That's basically the sense in which to understand
per modum cibi. Now, where there might be some ambiguity would be for something like vitamins. I believe that most theologians would consider them as food if they're being taken for mere nutrition, as a nutritional supplement ... but if there's some medical need for it, say, if you don't get this particular B12 vitamin you might risk passing out, that would be consumed / ingested "in the manner of" medicine. So, the rule of thumb would be the necessity to take it during that time window. Would something bad happen to your health if you waited until after Mass to consume the vitamins? If not, then IMO it would break the fast. If so, then it would not ... since it would be medicinal.
Similarly, if a bit of food were to, say, dislodge from your teeth from an earlier meal, or a piece of skin from your mouht, and you ended up ingesting it, that would not be consider
per modum cibi either, since it's not consider to be the equivalent of deliberately eating it for a meal.