MV Question about passives activating?

I've been doing a bit of reading and trying to understand how Yanfly's autopassives plugin works and functions. But I'm not entirely sure if what I'd like is possible? I'm not the smartest when it comes to using plugins and putting the right lines at the right place. Or even formatting it properly so things work. So I may have just misunderstood something.

Basically I was wondering if it is possible for a character's passive to active upon getting hit?

Example: Character A gets hit by enemy, he gets an attack buff of 10%. And this can be repeated for say up to 5 times and then he cannot gain buffs further (so 50% max).

And also if it's possible to make it that Party members have a passive activate based on which Party members are in it?

Example: Character A & B get a higher chance to crit enemies if Character C is in the Party. And if Character C is not in it, that won't activate.

Is such a thing possible? Thanks in advance! 🙂

Apologies in advance if I'm not posting it in the right place or if I'm not being clear about what I want!
your 1st example would probably require some 'custom react effects' and some other code stuff im no good with. your example 2 sounds like its just a simple 'state aura' effect on actor C
As Tiamat said, your second question is the entire purpose of Yanfly's Passive Aura Effects plugin.

The first part is handled by the Buffs & States Core, with the Custom React Effect notetag that will run the included JavaScript whenever the actor with that state gets hit in combat. I would use the state counter to track and calculate the bonus they're getting.
Moved to: Plugin Support
As Tiamat said, your second question is the entire purpose of Yanfly's Passive Aura Effects plugin.

The first part is handled by the Buffs & States Core, with the Custom React Effect notetag that will run the included JavaScript whenever the actor with that state gets hit in combat. I would use the state counter to track and calculate the bonus they're getting.

Would you be kind to write an example of how to set up the Custom React Effect? I'm guessing it goes into the actor's notetag, but I'm not sure how to format it.

As it says:

<Custom React Effect>

value -= 100;

value -= user.def;

</Custom React Effect>

But I'm not sure what to put at both values or how to work with it. I just need an example for say, stacking attack. If I just see how it is written down, I can work my way from there.
MV, by default, doesn't support states having dynamic effects. So for that part of it, you'll need to use this plugin:

In the passive state, put this:
Code:
<Custom React Effect>
user.addStateCounter(x, user.getStateCounter(x)>4 ? 0 : 1);
</Custom React Effect>

<params>
ATK: ((current * 0.1) * a.getStateCounter(x));
</params>

This should give the passive state a counter each time the actor is hit, to a maximum of 5; and give a 10% buff to their Attack per counter. You need to replace all instances of "x" with the ID of your passive state.

Also, I presume you want this to reset on each battle - to do that, you'd either use a plugin to run a common event at the end of battle, or give all of your troops a turn 0 event (or use Yanfly's Base Troop Events to save on copy/pasting).
MV, by default, doesn't support states having dynamic effects. So for that part of it, you'll need to use this plugin:

In the passive state, put this:
Code:
<Custom React Effect>
user.addStateCounter(x, user.getStateCounter(x)>4 ? 0 : 1);
</Custom React Effect>

<params>
ATK: ((current * 0.1) * a.getStateCounter(x));
</params>

This should give the passive state a counter each time the actor is hit, to a maximum of 5; and give a 10% buff to their Attack per counter. You need to replace all instances of "x" with the ID of your passive state.

Also, I presume you want this to reset on each battle - to do that, you'd either use a plugin to run a common event at the end of battle, or give all of your troops a turn 0 event (or use Yanfly's Base Troop Events to save on copy/pasting).
I might be misunderstanding, but if I replace the "x" with the ID of the passive state, how can I apply it to a specific actor? Through Yanfly's autopassives it makes it so ALL actors have it.
Would it go through adding "<Passive State: x>" to the actor's notetags and replacing the "x" with the ID of the passive state?
I might be misunderstanding, but if I replace the "x" with the ID of the passive state, how can I apply it to a specific actor? Through Yanfly's autopassives it makes it so ALL actors have it.
There are no states given to all actors unless you specify it in the plugin parameters. The most common use for passive states is to give them to a specific actor/enemy/skill via notetag.

Beside that, the x you're replacing in the code I gave you can not possibly have anything to do with an actor.

Original thread: https://forums.rpgmakerweb.com/threads/question-about-passives-activating.138771/