Is it possible to create this passive state?

Hello everyone, I am trying to create a passive state with Yanfly's Auto Passive States and Buffs & States Core plugins, however I am not sure if it can create what I want.
My idea is to create a passive status that has a % chance of activating and that allows the user to heal health and receive a status when they kill an enemy.
To give an example, the passive state would be like this:
There is an 8% chance that killing an enemy will heal the user for 1 HP and receive status #3.
I have tried this:
Code:
<Custom Turn Start Effect>
if (target.hp<=0)
{
    user.gainHp(1);
    user.addState(3);
}
</Custom Turn Start Effect>
However, I am not getting any results and I do not know how to indicate that the state is activated a % of the time.
Is it possible to create something similar to what I need?
you have to approach it differently. the note tags labeled "Custom timing effects" like turn start in the help file dont interact with your skill's target by themselves. you want tags under "Custom Action Effects". Those ones refer to the skill being used directly and target refers to the target of the skill being used.

even though you can use target and user within turn start, they both refer to the battler with the state active on them. so your current code checks if the battler with the state has 0 hp at the start of the turn, and if so, then heals them by 1 and gives them state 3. That cant happen cause theyd be dead and wouldnt have the state if that were to be true without immortality

something like this should do
Code:
<Custom Initiate Effect>
if (target.hp>0) user._killCheck=true;
</Custom Initiate Effect>

<Custom Conclude Effect>
if (target.hp == 0 && user._killCheck && Math.random() <= 0.08) {
  user.gainHp(1);
  user.addState(3);
};
delete user._killCheck;
</Custom Conclude Effect>
itll check at the start of your skills if the target has more than 1 hp(so is alive and isnt immortal at 0hp), and should from there they hit 0 hp, the effect happens at an 8% chance
you have to approach it differently. the note tags labeled "Custom timing effects" like turn start in the help file dont interact with your skill's target by themselves. you want tags under "Custom Action Effects". Those ones refer to the skill being used directly and target refers to the target of the skill being used.

even though you can use target and user within turn start, they both refer to the battler with the state active on them. so your current code checks if the battler with the state has 0 hp at the start of the turn, and if so, then heals them by 1 and gives them state 3. That cant happen cause theyd be dead and wouldnt have the state if that were to be true without immortality
Buff, I'm sorry, I'm absolutely new to Java and my English is very basic, but I think I understood you.

something like this should do
Code:
<Custom Initiate Effect>
if (target.hp>0) user._killCheck=true;
</Custom Initiate Effect>

<Custom Conclude Effect>
if (target.hp == 0 && user._killCheck && Math.random() <= 0.08) {
  user.gainHp(1);
  user.addState(3);
};
delete user._killCheck;
</Custom Conclude Effect>
itll check at the start of your skills if the target has more than 1 hp(so is alive and isnt immortal at 0hp), and should from there they hit 0 hp, the effect happens at an 8% chance
This code worked perfectly, I edited it a little to show the healing in combat and it turned out perfect ^^

However, I've been building more passive abilities and I've hit some walls...again.
I'm going to put them here, in case you have a moment to give me a hand.

1- I have a couple of states that don't heal over time or after finishing a battle (states like Poison).
However I would like to create a passive state that has an 8% chance to activate and cure those states.
Is it possible to create that?

2- I wanted to create a passive state that activates at the beginning of the round with an 8% chance and that passive state grants +2 Agility.
I have the Base Parameter Control plugin (by Yanfly), so I figure I should use "<agi Plus: +2>", but I don't know how to make said passive only activate 8% of the time.

3- I want a state like the previous one, but instead of getting +2 Agility, it would be +2 Defense, so I imagine the code would be the same but with "<def Plus: +2>".

4- I wanted to make a passive state similar to the one I mentioned in the previous message, but with certain changes. I would like for attacking (not killing) to have an 8% chance of healing yourself for 2 HP.

5- A passive state that activates 8% of the time and heals 1 HP when attacking or dodging.

6- A passive state, which activates 8% of the time, and deals 2 HP to the enemy when dodging.

7- Is it possible to create a passive state that triggers a common event 8% of the time after attacking or dodging?

8- A passive state that triggers 8% at the start of the round that heals 2 HP.

9- The last one may be too complex and not possible to do, but I ask anyway.
I wanted to make a passive status that, when a character has it, changes the speed of movement on the map (the idea is that it allows you to move faster) or allows you to run.

Thank you very much for everything you can help me with, I will be eternally grateful^^
I'm absolutely new to Java
Just a correction. Its javascript, not java. they sound similar but theyre very different and looking for online help for how to do something in java most likely wont help you when you need javascript.

Ill describe what you should do for each, and should you from there need additional help, share what you have. some of these are more basic than you think. Youve seen what code you need to pull off most of these effects, and the tags for when they should be ran is all in the documentation for the buffs and states plugin. you might be overthinking portions of them.

I would like to create a passive state that has an 8% chance to activate and cure those states.
Is this state supposed to clear each of those states at the end of each turn or after each battle? also is it supposed to be an 8% chance to clear all of them, or an 8% chance for each one to be cleared? thats a very important distinction cause itll affect how youll have to write it.

youd need to use the right tag for the timing for when you want the effect to happen, but for the most part its just going to be some combination of checking Math.random() <= 0.08 and user.isStateAffected(x) for each state with user.removeState(x) should the check(s) return true.

wanted to create a passive state that activates at the beginning of the round with an 8% chance and that passive state grants +2 Agility.
I havent used used the base parameter plugin, but a quick glance at the yanfly website page and at the tag you gave leads me to believe that all you need is a passive state with a <custom battle effect> to add a state to the user with that <agi Plus: +2> tag in it

I want a state like the previous one, but instead of getting +2 Agility, it would be +2 Defense, so I imagine the code would be the same but with "<def Plus: +2>".
correct

I wanted to make a passive state similar to the one I mentioned in the previous message, but with certain changes. I would like for attacking (not killing) to have an 8% chance of healing yourself for 2 HP.
you'd just need a state with a <custom confirm effect> and conditional check. You can use "this.isDamage() && this.isForOpponent()" to make sure that damaging skills for enemies activate the effect and "Math.random() <= 0.08" to make it happen at an 8% chance

A passive state that activates 8% of the time and heals 1 HP when attacking or dodging.
thats more or less just combining the previous state and the dodge state 2 weeks ago into a single state with both tags.

A passive state, which activates 8% of the time, and deals 2 HP to the enemy when dodging.
that one is almost entirely the same as the one from 2 weeks ago. just remove the bits to heal the target and add the same random percentage check from before into its conditional.
Is it possible to create a passive state that triggers a common event 8% of the time after attacking or dodging?
you can use $gameTemp.reserveCommonEvent(x) to call the common event with x ID. combine with previous states

A passive state that triggers 8% at the start of the round that heals 2 HP.
<Custom Turn Start Effect> + conditional

The last one may be too complex and not possible to do, but I ask anyway.
I wanted to make a passive status that, when a character has it, changes the speed of movement on the map (the idea is that it allows you to move faster) or allows you to run.
the way i see it, it shouldnt be a passive. it would be a regular state with an apply effect that has $gamePlayer.setMoveSpeed(x), and a remove effect to set it back to 4(default).

Id be careful with that if i were you though. if you arent careful with when that is applied and removed, itll be possible to have a player retain that higher speed and it might cause problems down the line
Hello, thank you very much for your help. With the instructions you have given me I have been able to make several codes (you are a great teacher, I didn't think I would be able to do them).
Of the nine passive states, I have been able to get five working, however there are four that don't work very well.
I'm going to leave the codes below in case you can take a look (I'll leave those that work well in green, but you can review them anyway. And I'll leave those that don't work in red).
Is this state supposed to clear each of those states at the end of each turn or after each battle? also is it supposed to be an 8% chance to clear all of them, or an 8% chance for each one to be cleared? thats a very important distinction cause itll affect how youll have to write it.

youd need to use the right tag for the timing for when you want the effect to happen, but for the most part its just going to be some combination of checking Math.random() <= 0.08 and user.isStateAffected(x) for each state with user.removeState(x) should the check(s) return true.
Spoiler
<Custom Action Start Effect>
if (user.isStateAffected(3) && Math.random() <= 0.08) {
user.removeState(3);
};
if (user.isStateAffected(4) && Math.random() <= 0.08) {
user.removeState(4);
};
</Custom Action Start Effect>
This code works perfectly, states like "Poison", which are not removed as the turns pass, now have a small percentage of being removed on their own.

I havent used used the base parameter plugin, but a quick glance at the yanfly website page and at the tag you gave leads me to believe that all you need is a passive state with a <custom battle effect> to add a state to the user with that <agi Plus: +2> tag in it
Spoiler
<Custom Turn Start Effect>
if (Math.random() <= 0.08) {
user.addState(48);
};
</Custom Turn Start Effect>
With this code I have made the decision to make it have an 8% chance of activating another state. That other state has "<agi Plus: +2>"
This way, if another skill grants the same status, agility will not be staked, only the chance.
To explain myself in another way, if this code had "<agi Plus: +2>" and the character had the same skill twice, he could have +4 agi and I don't want that, I want if he have the same skill twice, he have 16% chance to activate +2 Agi.
This leads me to the following: I have put this code in two skills, with a probability of 50% each. That means that, having both skills, it should be activated 100% of the time and that has not happened... :/
Do the probabilities up?

Spoiler
<Custom Turn Start Effect>
if (Math.random() <= 0.08) {
user.addState(49);
};
</Custom Turn Start Effect>
Nothing more to comment, it works perfectly and I used the same system as the previous one.

you'd just need a state with a <custom confirm effect> and conditional check. You can use "this.isDamage() && this.isForOpponent()" to make sure that damaging skills for enemies activate the effect and "Math.random() <= 0.08" to make it happen at an 8% chance
Spoiler
<Custom Confirm Effect>
if (this.isDamage() && this.isForOpponent() && Math.random() <= 0.08) {
user.gainHp(2);
};
</Custom Confirm Effect>
It works perfectly^^

thats more or less just combining the previous state and the dodge state 2 weeks ago into a single state with both tags.
Spoiler
<Custom Confirm Effect>
if (this.isDamage() && this.isForOpponent() && Math.random() <= 0.08) {
user.gainHp(1);
};
</Custom Confirm Effect>

<Custom Deselect Effect>
if (target.result().missed || target.result().evaded && Math.random() <= 0.08){
target.result().clear();
target.gainHp(1);
target.startDamagePopup();
}
</Custom Deselect Effect>
I have run into a problem here, the first part works correctly (when I attack, there is an 8% chance of healing me for 1 HP), however, in the second part, whenever I dodge, I heal myself 1 HP. For some reason it doesn't happen 8% of the time, it happens 100% 😳

that one is almost entirely the same as the one from 2 weeks ago. just remove the bits to heal the target and add the same random percentage check from before into its conditional.
Spoiler
<Custom Deselect Effect>
if (target.result().missed || target.result().evaded && Math.random() <= 0.08) {
user.gainHp(-2);
user.startDamagePopup();
if (user.hp<=0)
user.performCollapse();
}
</Custom Deselect Effect>
The same thing happens here as in the previous one, instead of being activated 8% of the time, it is activated 100%.

you can use $gameTemp.reserveCommonEvent(x) to call the common event with x ID. combine with previous states
Spoiler
<Custom Confirm Effect>
if (this.isDamage() && this.isForOpponent() && Math.random() <= 0.08) {
$gameTemp.reserveCommonEvent(20);
};
</Custom Confirm Effect>

<Custom Deselect Effect>
if (target.result().missed || target.result().evaded && Math.random() <= 0.08){
$gameTemp.reserveCommonEvent(20);
}
</Custom Deselect Effect>
Same problem: when I dodge instead of activating 8% of the time, it activates 100%.

<Custom Turn Start Effect> + conditional
Spoiler
<Custom Turn Start Effect>
if (Math.random() <= 0.08) {
user.gainHp(2);
user.startDamagePopup();
};
</Custom Turn Start Effect>
This one works perfectly

the way i see it, it shouldnt be a passive. it would be a regular state with an apply effect that has $gamePlayer.setMoveSpeed(x), and a remove effect to set it back to 4(default).

Id be careful with that if i were you though. if you arent careful with when that is applied and removed, itll be possible to have a player retain that higher speed and it might cause problems down the line
Spoiler
$gamePlayer.setMoveSpeed(5)
I have a problem here: I have no idea how I should put the code here, hahaha
have run into a problem here, the first part works correctly (when I attack, there is an 8% chance of healing me for 1 HP), however, in the second part, whenever I dodge, I heal myself 1 HP. For some reason it doesn't happen 8% of the time, it happens 100%
the only thing i can imagine wrong with that state is an order of operations error for the conditional. use parentheses to group together the check for missing and evading and it should work. otherwise, it looks correct

The same thing happens here as in the previous one, instead of being activated 8% of the time, it is activated 100%.
same here

I have two problems here. The first is the same as before: when I dodge instead of activating 8% of the time, it activates 100%.
The other problem is more complex to explain, but I THINK I have solved it, however, I have noticed (only in this skill), that when the character's speed + attack speed is equal to the enemy, the character always attacks first, except if this passive is active 😳
The formula I have set for Action Speed in Battle Engine Core is, simply, "agi", hahaha. So I don't know what triggers the enemy to attack first sometimes.
the first problem is the same as the other 2 yeah, but the 2nd one might just be bias? how many times did you notice that happen? how are you tracking whether or not the player should go first? what are the odds that randomization made it so that all the times you checked, the player happened to go last?

I have a problem here: I have no idea how I should put the code here, hahaha
you want a state with a set of opening and closing <Custom Apply Effect> tags and a set of opening and closing <Custom Remove Effect> tags with that line i gave you in-between each. lower numbers result in higher speed, so the apply one should have 3 while the remove one should be 4 to return back to normal. the 5 would make the player move slower.

Good to see you got most of these down. its just a slight hiccup that prevents 3 of these from working as intended. the action order one sounds strange, but you said you found a workaround for it so thats no issue. The last one is just a use of apply and removal tags to execute the code.

This leads me to the following: I have put this code in two skills, with a probability of 50% each. That means that, having both skills, it should be activated 100% of the time and that has not happened... :/
Do the probabilities up?
no actually. if you have 2 events with a 50% chance of happening, then there are 4 outcomes each with 25% chance. both events happen, the first event alone happens, the second event happens, or neither happens.

In this case, since its two passives triggering the same state and states dont stack, the 1st, 2nd, and 3rd all have the same effective outcome, but the idea still applies. theres a 25% chance that both passives trigger (you get the state), 25% chance the first passive triggers (you have the state), 25% chance the second triggers (you have the state), and a 25% chance neither triggers (you dont have the state). so theres a 75% chance you get the state and a 25% chance you dont.

if you want to make it where having both skills guarantees a state, youll have to change the logic of at least one of the skills. If you write an extra clause somewhere into one of those skills that says "if the user has the other skill, add the state" then youll have your intended result of having both skills guaranteeing the state.
the only thing i can imagine wrong with that state is an order of operations error for the conditional. use parentheses to group together the check for missing and evading and it should work. otherwise, it looks correct
I have managed to make the states activate by 8% by putting the parenthesis, as you told me, like this:
if ((target.result().missed || target.result().evaded) && Math.random() <= 0.08)

the first problem is the same as the other 2 yeah, but the 2nd one might just be bias? how many times did you notice that happen? how are you tracking whether or not the player should go first? what are the odds that randomization made it so that all the times you checked, the player happened to go last?
Sorry, you started replying the message before I edited it.
I discovered that the cause was because the character has several actions per turn and when he uses two skills of different speed he does some kind of average. Don't listen to me, hahaha.

you want a state with a set of opening and closing <Custom Apply Effect> tags and a set of opening and closing <Custom Remove Effect> tags with that line i gave you in-between each. lower numbers result in higher speed, so the apply one should have 3 while the remove one should be 4 to return back to normal. the 5 would make the player move slower.
I have tried this, but there has been no way.
I don't notice that the character's speed when walking around the map changes.
Code:
<Custom Apply Effect>
$gamePlayer.setMoveSpeed(2)
</Custom Apply Effect>

<Custom Remove Effect>
$gamePlayer.setMoveSpeed(2)
</Custom Remove Effect>
Is there something I'm doing wrong?

no actually. if you have 2 events with a 50% chance of happening, then there are 4 outcomes each with 25% chance. both events happen, the first event alone happens, the second event happens, or neither happens.

In this case, since its two passives triggering the same state and states dont stack, the 1st, 2nd, and 3rd all have the same effective outcome, but the idea still applies. theres a 25% chance that both passives trigger (you get the state), 25% chance the first passive triggers (you have the state), 25% chance the second triggers (you have the state), and a 25% chance neither triggers (you dont have the state). so theres a 75% chance you get the state and a 25% chance you dont.

if you want to make it where having both skills guarantees a state, youll have to change the logic of at least one of the skills. If you write an extra clause somewhere into one of those skills that says "if the user has the other skill, add the state" then youll have your intended result of having both skills guaranteeing the state.
Perfect, then it works great ^^
However, I have encountered a problem.
This time it's not due to javascript, although it may be the solution.
I have two states that must resist other states.
To do this, I created a state that has State Rate * Poison 92%.
That means it has 8% resistance to Poison.
The other state is similar and has State Rate * Poison 92%, that is, it also gives 8% defense to poison.
However, if a character has both passive states, poison resistance is not added (I checked the numbers using a plugin).
I don't mean that it has 16%, but I would like it if a character has both states, they would have more resistance than if they only had one.
Do you think there is any solution?

Thank you very much for everything again!
I have tried this, but there has been no way.
I don't notice that the character's speed when walking around the map changes.
Code:
<Custom Apply Effect>
$gamePlayer.setMoveSpeed(2)
</Custom Apply Effect>

<Custom Remove Effect>
$gamePlayer.setMoveSpeed(2)
</Custom Remove Effect>
it looked correct, so i tried it and it worked. it did show me that i was wrong about the values though. higher numbers increase speed and lower ones decrease it. i hastily looked at the editor, saw an 8 next to slowest and said that higher numbers are slower. Id change it to
Code:
<Custom Apply Effect>
$gamePlayer.setMoveSpeed(5);
</Custom Apply Effect>

<Custom Remove Effect>
$gamePlayer.setMoveSpeed(4);
</Custom Remove Effect>

other than that, it worked for me the way you had it originally but i made a change so that removal set the speed back to 4. you had it so that both application and removal set the speed to 2, so your speed never actually goes back to what it was. i made an item to give and remove the state, used it, got the state, became slower, used it again, removed it, and became faster. did you make sure that one of your actors actually got the state? Give it an icon to make sure.

but I would like it if a character has both states, they would have more resistance than if they only had one.
thats a tricky one. to get it working exactly the way youd want youd have to rewrite how the engine handles state rate and state application. by default, your rate would .92*.92 which is 85%ish. if you were to change it to increase with each, youd have to make each one 1.08 and invert the calculations so that a lower state rate is higher susceptibility and a higher rate is higher resistance.

heres a workaround: you can put a check in both states so that if the *other* one is already on the target, add a third state that also has some poison protection. then also make it so that when either one is removed, that third one is removed too
Code:
<Custom Apply Effect>
$gamePlayer.setMoveSpeed(5);
</Custom Apply Effect>

<Custom Remove Effect>
$gamePlayer.setMoveSpeed(4);
</Custom Remove Effect>
Hmm... it's not working for me 😳
What I have done is put that code in Notes in a State.
Then I create the skill and add the note to make it a passive skill.
I then have the character learn the skill (the state icon appears), but I don't notice him walking faster...
I've been testing things and have seen the following:
If the skill is like I mentioned just above, it doesn't work.
However, if the skill is not passive (instead of putting "<Passive State: 96>" in Notes, I put "Add state 96 * 100%" in Effects) and the character use the skill actively on himself, the skill works 😳

thats a tricky one. to get it working exactly the way youd want youd have to rewrite how the engine handles state rate and state application. by default, your rate would .92*.92 which is 85%ish. if you were to change it to increase with each, youd have to make each one 1.08 and invert the calculations so that a lower state rate is higher susceptibility and a higher rate is higher resistance.

heres a workaround: you can put a check in both states so that if the *other* one is already on the target, add a third state that also has some poison protection. then also make it so that when either one is removed, that third one is removed too
Then I should create two states.
State 1 should give State Rate * 92% and state 2 too and create a state 3 that has State Rate * 85%. I should then create code in state 1 that says if the character has state 2, get state 3 (and in state 2 that if the character has state 1, get state 3).
Is that correct? If correct, how should I make the code?
Code:
<Custom Apply Effect>
If (user.isStateAffected(2)) {;
user.addState(3);
};
</Custom Apply Effect>
Like this?
Actually, it would not be necessary to put the "remove status 3" part because in my project the passive abilities are not removed, so once it is obtained he will never lose the passive.

One more question, I have a series of skills that should cause fixed damage and should not be affected by passives like "recover 1 HP when you attack" or "deal 2 damage to a random enemy when you kill".
Do you think it would be a good idea for these skills to cause damage to the enemy through a code? (so they wouldn't be affected by the passives I've already created, right?)
Something like:
Code:
<Post-Damage Eval>
if (enemy)
{
    enemy.gainHp(-2);
}
</Post-Damage Eval>
Or maybe this code is a mess? Hahaha
Thank you very much for your help^^
However, if the skill is not passive (instead of putting "<Passive State: 96>" in Notes, I put "Add state 96 * 100%" in Effects) and the character use the skill actively on himself, the skill works
yeah, i had mentioned that before
the way i see it, it shouldnt be a passive. it would be a regular state with an apply effect that has $gamePlayer.setMoveSpeed(x), and a remove effect to set it back to 4(default).
Passive effects do not trigger apply and remove effects when turning on. youd have to call the add/removestate functions on them to get those effects to happen. when i suggested not to make it a passive, it was with that in mind.

if you wanted it to be a passive, youd either have to use the addstate function for it somewhere within the game (and at that point you might as well use the event commandto do that), or use a timing effect make it do something like apply it after every fight, which is going to feel strange that after getting it, youd have to take part in a battle to get it and it happens only once. its going to be jank either way


Actually, it would not be necessary to put the "remove status 3" part because in my project the passive abilities are not removed, so once it is obtained he will never lose the passive.
that changes alot actually. ive been considering things with the possibility of these needing to be turned off at any point. i had also forgotten that these were supposed to be passives too when you mentioned the poison resistance states. id suggest a change for the third poison state resistance state then:

make that 3rd state passive, and have the player start with it, but use the <Custom Passive Condition> notetag inside it to make it so that its only active when the other two resist states are active. use the <Custom Passive Condition>note tag for passives and user.isStateAffected(x) to accomplish this

the value for the state rates are up to you. it depends on how much stronger you want the effect of having both to be. youll just have to do the math to find out how strong the 3rd state should be if you want all 3 to provide x% protection and 2 of them are 8%. right now, the 2 8%s and the 15% results in 28% resistance (.92*.92*.85=.72)

One more question, I have a series of skills that should cause fixed damage and should not be affected by passives like "recover 1 HP when you attack" or "deal 2 damage to a random enemy when you kill".
Do you think it would be a good idea for these skills to cause damage to the enemy through a code? (so they wouldn't be affected by the passives I've already created, right?)
that can work, but you may run into issues. doing damage like that doesnt trigger many of the regular checks that happen when doing damage with a formula. without a damage formula, skills like that wont trigger isDamage(), but adding a 0 to the formula is going to cause a double popup.

You might want to create a notetag and code in exceptions to make this work.
lets say you make a notetag called <Ignore> and put it into skills you want your effects to ignore. in each of your effects you want to ignore those skills, youll have to add a condition to check if that tag is not on the skill being used. ill give you this

Code:
if (!$dataSkills[this._item._itemId].meta.Ignore)

//if you want to condense it to be more readable inside the notebox, you can also do this, but its the same effect.

var action = this._item._itemId;
action = $dataSkills[action];
if (!action.meta.Ignore)

if you put that inside any state's action effect notetag (initiate, select, confirm, react, conclude, deselect), itll read to see if the skill being used has <Ignore> in its notebox in the database and then you can have the state do the rest of the effect if its not there
if you wanted it to be a passive, youd either have to use the addstate function for it somewhere within the game (and at that point you might as well use the event commandto do that), or use a timing effect make it do something like apply it after every fight, which is going to feel strange that after getting it, youd have to take part in a battle to get it and it happens only once. its going to be jank either way
So... isn't there an easy way to make it work the way I want?
That is, in my project, every time a character levels up he gets a skill point that he can use to redeem a passive skill. I would like the moment the skill was redeemed, the group would move faster around the map, considering that once a passive skill is purchased, it cannot be removed (sorry to insist, but English is not my native language and I'm afraid of expressing myself poorly or not understanding what you're telling me).

that changes alot actually. ive been considering things with the possibility of these needing to be turned off at any point. i had also forgotten that these were supposed to be passives too when you mentioned the poison resistance states. id suggest a change for the third poison state resistance state then:

make that 3rd state passive, and have the player start with it, but use the <Custom Passive Condition> notetag inside it to make it so that its only active when the other two resist states are active. use the <Custom Passive Condition>note tag for passives and user.isStateAffected(x) to accomplish this

the value for the state rates are up to you. it depends on how much stronger you want the effect of having both to be. youll just have to do the math to find out how strong the 3rd state should be if you want all 3 to provide x% protection and 2 of them are 8%. right now, the 2 8%s and the 15% results in 28% resistance (.92*.92*.85=.72)
Well, I'm quite an idiot, I don't know why I told you that if an actor had two states that gave him resistance to poison, they don't add up.
Today I tried it again and they do add up.
Possibly, when I created the second state, I made a mistake adding the resistance type, sorry.

that can work, but you may run into issues. doing damage like that doesnt trigger many of the regular checks that happen when doing damage with a formula. without a damage formula, skills like that wont trigger isDamage(), but adding a 0 to the formula is going to cause a double popup.

You might want to create a notetag and code in exceptions to make this work.
lets say you make a notetag called <Ignore> and put it into skills you want your effects to ignore. in each of your effects you want to ignore those skills, youll have to add a condition to check if that tag is not on the skill being used. ill give you this

Code:
if (!$dataSkills[this._item._itemId].meta.Ignore)

//if you want to condense it to be more readable inside the notebox, you can also do this, but its the same effect.

var action = this._item._itemId;
action = $dataSkills[action];
if (!action.meta.Ignore)

if you put that inside any state's action effect notetag (initiate, select, confirm, react, conclude, deselect), itll read to see if the skill being used has <Ignore> in its notebox in the database and then you can have the state do the rest of the effect if its not there
Well, I made the skills work by removing the damage formula and putting in this code:
Code:
<After Eval>
if (target.hp>=0)
{
    target.gainHp(-2);
    enemy.startDamagePopup();
        if (enemy.hp<=0)
        enemy.performCollapse()
}
</After Eval>
If I kill with this code, passive skills like "When killing, the user recovers 1 HP" do not activate, so it is not necessary to modify all the codes, but thanks anyway^^
So... isn't there an easy way to make it work the way I want?
you could fake it. make your skill say that when you buy it the party becomes faster, but the skill doesnt actually do anything. then at the same time the skill is bought, run the command to speed up the party. how exactly are the skills being learned. what plugin?

Well, I made the skills work by removing the damage formula and putting in this code:
yeah, i didnt doubt that you could make a damaging skill that way, but itll have a few drawbacks. the way it is, that skill cannot miss, will not trigger checks done with the isDamage() method, and wont trigger counters i believe. they may not be relevant now, but it might later
you could fake it. make your skill say that when you buy it the party becomes faster, but the skill doesnt actually do anything. then at the same time the skill is bought, run the command to speed up the party. how exactly are the skills being learned. what plugin?
I am using Yanfly's "Skill Learn System" plugin.
With this plugin, every time a character levels up, they get a "skill point", which they can spend in the menu for a passive skill.
Each character has 9 purchasable passive skills (maximum level is 10), and once a passive skill is purchased, it cannot be deactivated.

yeah, i didnt doubt that you could make a damaging skill that way, but itll have a few drawbacks. the way it is, that skill cannot miss, will not trigger checks done with the isDamage() method, and wont trigger counters i believe. they may not be relevant now, but it might later
I THINK I'll leave it like that for now, because they are a series of special skills that can only be used once and cannot be dodged, so I think (and hope) they won't give me too many problems...
Sorry for the double post, but I thought of a possible alternative solution. If it is not possible to create a passive state that increases the speed of the party, would it be possible to create a passive state that allows running? That is, in my project "run" (tab) on the map is disabled. Would it be possible to have a passive state that, when an actor has it, the party can "run" by pressing tab? What do you think @Robro33?
Sorry for the double post
actually, its fine in this case. its only a double post if both messages were within 72 hours

would it be possible to create a passive state that allows running?
you should be able to. I think using event commands to do it would be more straightforward, but yanfly has a plugin to toggle dashing. Youll have to approach it a little backwards though. The only thing the plugin adds outside of plugin commands is a single tag to disable dashing completely.
You can have the player start with a passive state that contains the tag to disable dashing, and have its passive requirement being that they dont have the skill to enable dashing learned
actually, its fine in this case. its only a double post if both messages were within 72 hours
Oh! Okay, thanks!

you could fake it. make your skill say that when you buy it the party becomes faster, but the skill doesnt actually do anything. then at the same time the skill is bought, run the command to speed up the party. how exactly are the skills being learned. what plugin?
In the end I did something like this.
I created a skill that does nothing and then I created an event that triggers in parallel.
This event has a conditional that says that if X character has Y skill, the party speed is 5 (x2) and then a switch is activated to remove the event.
Now I just have to copy and paste this event to all maps in the game, since it is possible to purchase the skill at any time.

Would it be possible to change the group speed to x1.5? Or is that not possible?

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-create-this-passive-state.163797/