Custom Effects with YEP's Buffs & States core - endlessly repeating skills

Hi everyone.

I'm trying to create a state, that at the end of an actor or enemy's turn whom is affected by the state, will force a skill on them.

For instance, in a Custom Turn End Effect, I would like to force skill 54.

Using the "BattleManager.queueForceAction" command does not work, as skill 54 will endlessly repeat on the user. Here is how the actual skill is set up:

Spoiler
1580611200323.png

Initially I was using "Custom Action End Effect" and thought if I swapped it to Turn End, it would stop the infinite loop because skill 54 was considered an action. However, it made no difference.

So I thought I could try this instead:


JavaScript:
<Custom Turn End Effect>
if (! a._isThisForceActionInitiated) {
a.forceAction(54);
a._isThisForceActionInitiated = true;
}
</Custom Turn End Effect>
<Custom Turn Start Effect>
a._isThisForceActionInitiated = false;
</Custom Turn Start Effect>

Whereby if the flag was not on, it would execute the skill, followed by immediately turning the flag on so it would not execute the skill a second time. However, instead of endlessly repeating the skill in this case, it does not even occur once.

So now I'm a bit stuck, and was wondering how to execute a skill in a custom effect that only occurs on the user once.

Keep in mind, the poison idea is just a generic test, so I'm not really after advice on how to create a general poison skill in other more efficient ways.

Thanks!!!
Try this code.
Spoiler: Code
Code:
<Custom Turn Start Effect>
user._hasExecutedSkill = false;
</Custom Turn Start Effect>
<Custom Turn End Effect>
if(!user._hasExecutedSkill){
BattleManager.queueForceAction(user, 54, -2);
user._hasExecutedSkill = true;
}
</Custom Turn End Effect>
Perfect!

Thanks so much @rainyday
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/custom-effects-with-yeps-buffs-states-core-endlessly-repeating-skills.117847/