Force Hit or Force Miss via YEP/Lunatic Mode?

As title says.

The fantasy: If you've seen attack animations for Super Robot Wars, you'll know that each attack has two variations- one for when the attack hits, and one for when the attack misses. I would like to be able to replicate that. However, base RMMV appears to calculate damage immediately after hit accuracy- there's no in between. For the fantasy to work, I need to determine if the attack would hit or not > play the appropriate animation > apply damage and other on-hit effects if necessary.

The issue: I've theorized an alternative using YEP and Lunatic Mode, and run an IF ELSE statement to calculate accuracy from within the action sequence, and play the appropriate action from there. So far, what I need is: 1) getting the attacker's current HIT and target's EVA or MEV and putting those into variables; 2) using the right variables for the IF ELSE statement (I assume I must use the in-game numerical variables and cannot make ones up like in Lunatic Mode tags); and 3) getting the code for forcing the attack to hit or miss.

For #3, I may be able to get away with applying a state that forces perfect accuracy and 0% dodge for hitting the target, and vice versa. I am wondering if my fantasy has a more efficient execution from my plan, or if it can be done better. Looking forward to the help!

TIA
1) getting the attacker's current HIT and target's EVA or MEV
Exactly what you typed, user.hit, target.eva, target.mev. I'm not sure why you would need to put those into variables.

2) using the right variables for the IF ELSE statement (I assume I must use the in-game numerical variables and cannot make ones up like in Lunatic Mode tags);
If you want to replicate the default hit formula inside of your action sequence, it determines a miss with
Code:
Math.random() >= this.itemHit(target));
where itemHit is
Code:
return this.item().successRate * 0.01 * this.subject().hit;

You don't have to use a variable to reference the skill's Success Rate since you have it typed on the screen in front of you - if it's the default 100%, then your miss check would simply be:
Code:
if (Math.random() >= user.hit)

3) getting the code for forcing the attack to hit or miss.
The best thing to do is your suggestion of applying then removing a state that will make the attacker's hit be 1 or 0. Otherwise you're getting into an additional plugin to force a miss on, say, a toggled game switch.
Exactly what you typed, user.hit, target.eva, target.mev. I'm not sure why you would need to put those into variables.
I was anticipating needs. I presumed there needs to be variables for this thing.

If you want to replicate the default hit formula inside of your action sequence, it determines a miss with
Code:
Math.random() >= this.itemHit(target));
where itemHit is
Code:
return this.item().successRate * 0.01 * this.subject().hit;
You don't have to use a variable to reference the skill's Success Rate since you have it typed on the screen in front of you - if it's the default 100%, then your miss check would simply be:
Code:
if (Math.random() >= user.hit)
I'm not able to get this to work the way I wanted to, so I just did what you said above instead and that worked fine.

The best thing to do is your suggestion of applying then removing a state that will make the attacker's hit be 1 or 0.
Did this in tandem with the hit - eva formula, and it's now working as I hoped! This will not be put to waste.
I was anticipating needs. I presumed there needs to be variables for this thing.
Technically speaking, all data in the game is already stored in variables (unless it's being produced by a function call). The only time you need to put it in another variable is if you want to manipulate that data without affecting the original. (e.g. I want to multiply the actor's ATK by 2, use that for something, then subtract some result from that, use that for something, etc.)

it's now working as I hoped!
Glad to know. Have fun!

Original thread: https://forums.rpgmakerweb.com/threads/force-hit-or-force-miss-via-yep-lunatic-mode.151092/