How do I reduce hit chance before damage calculation?

I'm using VX Ace. I have a method of already doing this, but it doesn't always work as intended. I use the "add state" to the actor in the damage formula, and the state then reduces hit chance until the end of the turn. The problem is that sometimes the state doesn't get added to the actor fast enough before the damage is calculated.

My damage formula looks similar to this.

a.add_state(x); damage formula here

I need the hit chance reduction to ALWAYS take effect before damage calculation. It's sometimes works fast enough and sometimes it doesn't. Is there another method for this to work how I intend it to? This is only used on certain skills.
You would probably be better off with a script that lowers hit rates of skills instead, as the skill system was meant to use the to hit rate you assigned the actors in the database from the get go.

I've moved this thread to RGSSx Script Requests. Thank you.



Game Mechanics Design is for asking if you should implement something, not how to do it.
Any takers?

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-reduce-hit-chance-before-damage-calculation.130146/