MV Effect when enemy dies (YEP Buff & States Core)

Hello everyone,

I'm trying to make a state that heals the Magic Points of the Actor who kills the enemy.

With YEP Buff & States Core this should be easy, and I tried this:


<Custom Deselect Effect>
if (target.hp <= 0) {
user.gainMp(1000);
}
</Custom Deselect Effect>

But unfortunately this doesn't have any effect on the actor that kills the enemy with this state.
Can somebody give me a hint what's wrong here?
The code you posted works fine on my end.

I can think of 3 possible reasons why it's not working for you.
  1. The state isn't actually active on the target when it is killed.
  2. There is something wrong with the state. Please post a screenshot of the database entry of the state, including whatever else is in the note box.
  3. There is a problem with your plugins (wrong order, conflicting plugins, etc). Please post a screenshot of your plugin manager so we can check this.
Alright, thanks for checking this out. Looks some other scripts are overriding the "enemy dead" handling, as only "if (target.hp <= 0)" isn't working out, all other "ifs" I tried are working right.
I'll check my plugins for this.

Original thread: https://forums.rpgmakerweb.com/threads/effect-when-enemy-dies-yep-buff-states-core.136227/