Using stats in removing states

How to make the character’s parameter (for example, ATK) increase the chance of removing the state? And is it possible?
I just got idea of skill where actor's stat increases chance to remove state.
know how could do that in damage formula
Math.randomInt(Range)+Base < a.atk ? a.removeState(X); Formula
generate random number between Base and (Range+Base)
if stat higher then RNG remove state X
replace Formula with 0 or another damage formula

this check will run completely separate from any Effects to remove states

Original thread: https://forums.rpgmakerweb.com/threads/using-stats-in-removing-states.118949/