Yanfly Buff and States Core - Determine Last Used Skill ID

Hello!

Would someone be able to help me create a passive skill tag (using Yanflys Buffs and States Core) that I can use to get the ID of the last used skill?


I actually have gotten a bit of help with this a while back, and was given the following Custom Confirm Effect tag to use as a passive status effect.

<Custom Confirm Effect>
if (user.currentAction() && user.currentAction().isSkill()) {
user._lastSkillUsed = user.currentAction().item().id;
}
</Custom Confirm Effect>


The thing is, I still don't really understand how to get the skill I'd value into a variable. Im guessing it's as easy as placing something in the script box of a control variable, but I haven't had any luck figuring it out.

Alternativly, if there's an easier way to do this, such as through a script call of some sort, please let me know.
Hi, not sure if this is what you need but this will store the skill id in a game variables:
Code:
<Custom Confirm Effect>
if (user.currentAction() && user.currentAction().isSkill()) {
  var skillid = user.currentAction().item().id;
  $gameVariables.setValue(X, skillid)
}
</Custom Confirm Effect>
Hi, not sure if this is what you need but this will store the skill id in a game variables:
Code:
<Custom Confirm Effect>
if (user.currentAction() && user.currentAction().isSkill()) {
  var skillid = user.currentAction().item().id;
  $gameVariables.setValue(X, skillid)
}
</Custom Confirm Effect>

Thank you very much! I won't be able to test it for a few hours, but just by looking at it, it seems to be exactly what I'm hoping to do. I just need to replace the X with the variable ID, and have this state applied to all actors/enemies, right?
No prob!
Yes, X is to be replaced by the variables Id of your choice.
When any ally/enemy affected by the state that have this notetag will use a skill, skill Id will be store in the variable, so yes, depending on what you want to acheived, you could apply the state to all battlers.
Alrighty, I got a chance to test it out now, and it seems that it's half working.

I'm testing this by having a common event run after each skill use. Attacks from actors seen to work just fine, although enemies don't seem to update the variable.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-buff-and-states-core-determine-last-used-skill-id.118162/