MV Needing help yet again with a Javascript / plugin issue

So I'm trying to make it so that whenever a specific character (actor 2 in this case)
is targeted with a healing ability or item, that they increase a variable, (variable 80) turn on a switch, (switch 128)
which triggers a common troop event.

Plugins that I'm using relevant to what I'm trying to code:

Yanfly's battle core
Auto passive states:
Buffs and states core
Common troop events

I'm assuming a hidden passive state will work, but I'm pretty sure the problem is the code I'm putting in the conditionals
before the variables to check for healing, or possibly I'm choosing the wrong tag again. Also, I'm not sure if this only checks for a healing skill or item as well. Either way, it doesn't appear to be working and I'm not sure what I'm missing. I don't have the conditional stating specifically actor 2 has to be targeted, but since this is the only actor who will have the passive state, it should still work okay?

I tried this:
1716946634811.png


And when that didn't work, I tried this.

1716946492434.png
The first screenshot should do the things you say. What doesn't work?
Nothing apparently. The variable doesn't change and the switch doesn't trigger. I'm using a skill to heal the actor and variable stays the same.

Also tried it with an item.
if this only checks for a healing skill or item as well
should be both
I don't have the conditional stating specifically actor 2 has to be targeted, but since this is the only actor who will have the passive state, it should still work okay?
as long as only they have the passive, itll work when only they are targeted

Nothing apparently. The variable doesn't change and the switch doesn't trigger. I'm using a skill to heal the actor and variable stays the same.
random thought. the variable and switch are reserved, right? if you try to use the getter and setter for variables and switches past those youve set the maximum to include, you dont get an error, but it doesnt do anything

have you made sure the code is being ran at all? made sure the passive is actually on the battler?
I tried the passive on the actor and then the actor's class just to test. Neither worked.

What do you mean by getter and setter? Don't understand the terms. If you mean maximum game variables, I did expand that out.

I have an idea. Going to show heal skill and item I'm testing with. Maybe it will help. Since it's a static amount recovered and not using the damage formula, maybe that makes a difference on when this gets triggered? These are the skill and item I'm using to test.

1716954339246.png


1716954319980.png
isHpRecovery() is going to return false because the skill does not have the damage type of HP Recovery.

And there is no value because there's no damage formula to produce a value.
Okay so it needs a damage formula. Didn't realize that. Thanks again. *Edit* Bug fixed. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/needing-help-yet-again-with-a-javascript-plugin-issue.169079/