Multi-Hit Skills and Common Events

Hi guys 😠, I am writing in the forum because I have a problem with the project I am carrying out.
I've been looking for a solution on my own for some time, but since I can't figure it out, I rely on you.
I apologize if the request is not fully understandable.

I'll explain the situation:

In the project I have skills that, every time they hit the target, raise and / or lower variables.
I set the skill and added a simple common event that would allow me to do it.
Then the problem become starting the common event based on the result of the attack, that is, if the ability hit the enemy the common event trigger, if the ability missed no.
I solved it by creating a "state" that made it clear that the enemy / player was hit, so with a conditional branch I set the variable to increase only when, in fact, the enemy and the player were under the effect of the state.
Now I am faced with another dilemma concerning multiple strike skills.
If I set an ability to hit twice or more, I would like the variable to be calculated for all the hits, so I only increase it for those hits that strike. With one-hit skills, the "state" trick helps, but in the case of skills with two-hit or more, I don't know how to move.

I use Yanfly's battle engine core plugin, if you need screenshots or anything else there is no problem.

I hope you understand the problem and thank you in advance.
👋
You may be able to accomplish that by using this method from yanfly and doing a bit of editing to the lunatic code.
Thank you so much for the help but i don't know how to proceed with this method.

Other solutions to the problem are appreciated! 👋
Yanfly has a lot of documentation on his website on how to use his plugins and lunatic code. You might have better luck opening a new thread specifically asking for help with the lunatic code.
If I'm not mistaken, the method you advised me allows you to have the effect of a skill change based on how many times you have used it.

Not exactly what I requested...

I need to calculate common event variables for each hit of a multi-hit skill.

Example:
Player A uses Double Strike on Enemy B

First Hit: Missed
(the variable does not change)

Second Hit: Hit
(variable changes)

I hope you understand what I mean. If it is possible to achieve this through the method you recommended at the beginning of the thread then I apologize. 😔
Yes I believe it possible with that method. It already seems to do everything you want regarding your variable increase when the target is hit. All you need to do is change the damage formula to not increase every time. Also you may need to change magical damage to physical or edit the elemental damage to fit your specific skill.

Even if you know nothing about java script I believe if you study the code on that page you will see what needs to be edited.

Original thread: https://forums.rpgmakerweb.com/threads/multi-hit-skills-and-common-events.125157/