MV Displayed To-Hit rolls during combat?

I've been conceptualizing an idea for how to implement something like this for a bit now;

1) A skill is executed, and the actor runs up to the target

2) A visual of some sort appears to display the result of their Accuracy Roll, contesting the opponents Evasion or "Armor Class"

3) If the Accuracy Roll is equal to or higher than the Evasion/Armor Class, the attack proceeds as usual

4) If the Accuracy Roll is lower than the Evasion/Armor Class, the attack animation changes to a special whiff animation, and the skill is not successfully executed (like bouncing off armor or being deflected)

I'm considering using something like Yanfly's Act Sequence Packs in order to be able to do this, but I'm not sure how to make the Evasion and Accuracy Roll visible. One idea I had was to use a special damage formula to determine this:

if (b.eva * 100 <= (Math.randomInt(20) + 1 + a.agi)) Math.randomInt(a.atk * 2) + 1 - b.def; else 0

I've tested this formula before, so it does work as intended (with the "Whiff" animation being 0 damage when the attack fails) but only as far as damage goes. If the skill has a chance to do something like inflicting ailments, those would still have a shot at being applied...

Ultimately what I seek is a way to make the 4 mentioned criteria happen: the run up (easily accomplishable with ActSeq), the dice roll, and then the branching between hitting and whiffing. If anyone knows where to get started with this or how to make it work in some way, I'd appreciate the help.
The damage formula is not the right approach for this, as it takes place after the skill has been determined to hit.

You can absolutely use Action Sequences for this, but you have to understand which parts of the default skill system you will and won't use.

For example, you'd want your skills to all be certain hit, so that when you call action effect it doesn't make its own potentially-failing hit roll after you've determined yours.

And if you want your hit rolls to determine things like critical hits, you'd want to take a look at Yanfly's Critical Control plugin.

As far as how to make the rolls visible, I think I'd just make an animation for each value (so if you're emulating a D&D system, you have 20 animations).

Use action sequence commands to assign a variable a random value from 1-20, then use if/else blocks to display the corresponding animation above the user's head for their attack roll.

Then you just have one more if/else block to show what happens if the roll missed vs. a hit.

Original thread: https://forums.rpgmakerweb.com/threads/displayed-to-hit-rolls-during-combat.170661/