MV YEP Buffs & States Core + YEP Auto Passive States

I've came up with a lot of complicated regen states with the help of you guys and some on my own but I really am stumped on this one and it's probably simpler than I imagine...

I have a state called Black Flames (this could be any state but this is the one Im using for right now)
Normally it just takes away -7% HP per turn. but I want it to have a regeneration effect that checks if the Opposing party (whether it's player or enemy) has someone affected by state 102, if it does, the party with the state 102 will regenerate 1% HP and MP per turn.

This is my note tag so far

Notetag for Black Flames:

<State Animation: 477>

<Category: ailment>



<Custom Regenerate Effect>

if (user.isStateAffected(102)) {

user.gainHp(Math.floor(user.mhp * 0.01))
user.gainMp(Math.floor(user.mmp * 0.01))

}

else {



}

</Custom Regenerate Effect>

usually it does something but is checking for a passive state different or am I doing something wrong?

I have another question involving another skill and YEP Skill Core but I will ask that after this is potentially figured out
Didn't fully get what you asked, but if you want to check for passive states, from Yanfly's page it's:
battler.states().includes($dataStates[id])

And to check the whole opponent's unit, it's something like:
user.opponentsUnit().members().some(member => member.states().includes($dataStates[id]))
usually it does something but is checking for a passive state different or am I doing something wrong?
no, but based on what you said, arent your references confused?
I have a state called Black Flames (this could be any state but this is the one Im using for right now)
Normally it just takes away -7% HP per turn. but I want it to have a regeneration effect that checks if the Opposing party (whether it's player or enemy) has someone affected by state 102, if it does, the party with the state 102 will regenerate 1% HP and MP per turn.
so, ill call black flames state 101 - you wanted state 101 to have a regen effect that heals the opposing party if any member of the opposing party has state 102, right? what you shared just checks if the battler with state 101 has state 102 and will heal them if they do.

Didn't fully get what you asked, but if you want to check for passive states, from Yanfly's page it's:
battler.states().includes($dataStates[id])
while that should work for yanfly's passives, just a note - isStateAffected works in passives for the MV plugin. one of the VS changes got rid of that being the case and they offered that as a way to check
Didn't fully get what you asked, but if you want to check for passive states, from Yanfly's page it's:
battler.states().includes($dataStates[id])

And to check the whole opponent's unit, it's something like:
user.opponentsUnit().members().some(member => member.states().includes($dataStates[id]))
The whole opponents unit works but how do I get the side thats not affected by the state to regen, rather than the actor thats affected by the state

I think the problem lies in my code here

user.gainHp(Math.floor(user.mhp * 0.01))
user.gainMp(Math.floor(user.mmp * 0.01))

It's not user but it has to be the opposite I just can't find the context
I think the problem lies in my code here

user.gainHp(Math.floor(user.mhp * 0.01))
user.gainMp(Math.floor(user.mmp * 0.01))

It's not user but it has to be the opposite I just can't find the context
i am still not sure if we're on the same page here for what the state is meant to do.

if by the opposite, you meant you want it to run on every opponent and thats all youre missing, then you can do something like
Code:
user.opponentsUnit().aliveMembers().forEach(member => {
  member.gainHp(Math.floor(member.mhp * 0.01));
  member.gainMp(Math.floor(member.mmp * 0.01));
  member.startDamagePopup();
});
to heal each member of the opposing side from within the regenerate effect of this state
Okay I think I might have explained it poorly so let me show like a example:


1760142734018.png


I have the damage on the afflicted side in the MV traits, and the regen for the passive state is within the regen effect note tag
1760142951159.png
I had thought that to be the case, but between not getting confirmation on how i thought you wanted it to work and specific lines of code being pointed to, i figured i was mistaken

so within black flames, you can have it check if any opponent has state 102 and then heal each opponent afterwards

Code:
if (user.opponentsUnit().aliveMembers().some(member => member.isStateAffected(102))) {
    user.opponentsUnit().aliveMembers().forEach(member => {
        member.gainHp(Math.round(member.mhp * .01);
        member.gainMp(Math.round(member.mmp * .01);
        member.startDamagePopup();
    });
};
you may or may not need to force that damage popup there

Original thread: https://forums.rpgmakerweb.com/threads/yep-buffs-states-core-yep-auto-passive-states.180431/