Something Comlex

Everyone. How would I work it so that at the end of the turn, the amount of TP gained in battle is stored into a variable. Then, that variable is divided by another variable

Spoiler
which goes up by 1 every turn
and then have an event check the final result to (with the help of other variables, switches, and conditional branches) determine whether or not an effect happens that turn?

Original thread: https://forums.rpgmakerweb.com/threads/something-comlex.38316/