How about you can use the bathroom when you need to, and if you actually find instances of students not using the bathroom, cutting class, etc. you address it by punishing those students. Give them detention. Make them have a chaperone at random times. Suspend them. Punish the behavior you want to regulate (lying about using the bathroom to goof off) and don't try to regulate unrelated and uncontrollable bodily functions.