If you aren't working, why do you expect to be paid?
Let's say you take eight 15 minute potty breaks each day.
In an eight hour day, that means you're working 45nminutes and using the potty every 15 minutes each hours, all day long.
So, six hours of work time, two hours of potty time.
Is it legal?
I have no authority to make such a ruling.
If the employer is doing it, therefore employer must believe their actions comply with your state's labor laws.
The note from the physician says you should be allowed to use the potty when nature calls.
The note doesn't mean you must be paid for not working 25% of the day, just that you be permitted to use the potty frequently.