Issue with adding states to the user when he casts a skill

I don't know if there is a thread for this already, but when I want to add a state to the user when they use a skill, a few issues appear.


Short story, I made a "Fast Attack" skill which is supposed to make the user attack twice in a row, with each attack having a -35% HIT ex-parameter. I posted two screenshots to show the setup. The issues are:


1) When the user casts the skill, the first attack always connects, it doesn't matter if I change the HIT ex-parameter to -100%. I saw that when the user casts the skill, he doesn't receive the -35% HIT state immediately: it appears immediately after he finishes the first strike, and then it applies the desired effects to the second attack. I originally intended that the state was added as soon as he casted the skill (so it would affect his next two attacks), and not when he finished his first attack, but that doesn't happen and I don't know why.


2) The state isn't applied when you use it two turns in a row.


As an overview of what happens: the user casts the skill to attack an enemy twice, his first hit always lands because it isn't affected by the -HIT% state, while the second one is. The user then casts the same skill after the turn ends, and now he isn't affected by the state at all, which means that both his first and second hit land normally. The user then casts the skill again after the turn ends, and now the state is applied but once again only to the second strike, and so it repeats.


I don't know how to fix this, and I'd appreciate some help.


1.png


2.png
If you want the "Ataque rapido" skill to have a 65% chance to hit, then instead of applying a state to the actor, simply reduce the Success % of the skill from 100 to 65.
That was... much simpler than I expected. I thought the "Success %" option was referring to the chance of successful invocation of the skill (as in "You failed to cast this, so none of the skill's contents will take place, including the two attacks in a row").


Thanks for your help.
Actually, after a few tests, I'd much rather make the skill reduce the actor's HIT than adding a success chance to the skill itself. Mainly because there is equipment and other skills that boost the actor's HIT, thus making the character more "precise" and "skilled" with his attacks, which should give the actor a better chance to hit with a skill that is normally difficult to land on the opponent. The "Success %" option doesn't allow for that as far as I've tested, and it will always make a skill have the same chance to fail no matter what other factors are involved. 


So yeah, the issue is still there. If someone knows how to solve it, I'd be thankful for an answer.
The problem here is that the damage formula is executed after the hit has been successfull - after all, you don't need to apply damage if you miss.


Because of this, any effect added by damage coding will always only affect the future, not the skill itself.


The success roll is independent of the HIT-Roll, and both need to be successfull for a skill to be executed.


So basically, if you want to give a skill an reduced HIT-Chance, you'll need a script/plugin that changes the skill processing, it can't be done by default.
I see. I searched for a script like that, but I didn't found anything

Original thread: https://forums.rpgmakerweb.com/threads/issue-with-adding-states-to-the-user-when-he-casts-a-skill.64961/