Instead of boolean use a number n with initial state 0 or 1 depending if you want it to start as false or true. Then every time you want it toggled set state n = n + 1
When you want to evaluate the Boolean just use modulo 2 function on n
So condition n mod 2 is ‘1’
The result depending on n will be
n = 0 -> no
n = 1 -> yes
n = 2 -> no
n = 3 -> yes
And so on…
This is you Boolean toggle.