Custom Status Effects/Passives (Idk if i posted in the right place)

Hey everyone!, today (or tonight depending on when your reading this) I came to share some of my states i made using most if not ALL of Yanfly's plugins, I might continue to update this thread whenever I have the time but for now i'll hand off what I have currently and give a brief description of what all of States do:


Lord Of Clouds UPDATED.
Spoiler: Lord Of Clouds
<Custom Apply Effect>
var targets = $gameParty.members().concat($gameTroop.members());
var success = false;
for (var i = 0; i < targets.length; i++) {
if (targets.isEnemy() && targets.hp > 0) {
var resistances = targets.elementRate();
if (resistances[windElementId] < 1) { // if the target is not resistant to wind
var damage = targets.hp * 0.25; // deal 25% of target's max HP as damage
targets.gainHp(-damage);
targets.addState(stateId); // apply the state that grants the Lord of Clouds effect
success = true;
}
}
}
if (success) {
user.addState(stateId); // apply the state that grants the Lord of Clouds effect to the user
}
</Custom Apply Effect>

<Custom React Effect>
var downed = BattleManager._action._targets.filter(function(target) {
return target.result().isHit() && target.hp === 0;
});
if (downed.length > 0) {
for (var i = 0; i < $gameParty.members().length; i++) {
var actor = $gameParty.members();
actor.gainMp(3);
actor.addState(RepelMagicStateId); // apply the state that grants the Repel Magic effect
}
}
</Custom React Effect>

The Lord of Clouds effect grants the user Elec Pierce or in this case Any Element you use in place of the Electric Element will Pierce, a 20% boost to Elec or any other elemental damage. Additionally, when a party member (including the user) downs a demon, all allies will recover 3 MP and gain the Repel Magic state for one turn.
Origin: (Shin Megami Tensei Dx2) [Android/iOS]



All In One Buff and Debuff states:
This one is pretty self Explanatory, these States basically apply Buffs and or Debuffs to the User/Enemy throughout a battle, I find this much easier to use than messing with the parameters, the best part about this is that it also Stacks!. so you can Buff yourself as much as you want until you cap out at your Games max damage!


Offense/Attack Increase:

Spoiler: Offense/Attack Increase
<Custom Apply Effect>

// Set the variable rate to 1.1 to increase attack by 10%

var rate = 1.1;

// Calculate the new attack value

var newAtk = Math.floor(user.atk * rate);

// Set the buffed attack value

user.addParam(2, newAtk);

// Add the buff state with no duration limit

user.addBuff(2, -1);

</Custom Apply Effect>

<Help Description>

Buff phys attack once

</Help Description>

Magic Attack Increase:


Spoiler: Magic Attack Increase
<Custom Apply Effect>

// Set the variable rate to 1.1 to increase magic attack by 10%

var rate = 1.1;

// Calculate the new magic attack value

var newMatk = Math.floor(user.mat * rate);

// Set the buffed magic attack value

user.addParam(4, newMatk);

// Add the buff state with no duration limit

user.addBuff(4, -1);

</Custom Apply Effect>

<Help Description>

Buff magic attack once

</Help Description>

Defense/Magic Defense Increase:


Spoiler: Defense/Magic Defense Increase
<Custom Apply Effect>

// Set the variable rate to 1.1 to increase defense and magic defense by 10%

var rate = 1.1;

// Calculate the new defense value

var newDef = Math.floor(user.def * rate);

// Calculate the new magic defense value

var newMdef = Math.floor(user.mdf * rate);

// Set the buffed defense and magic defense values

user.addParam(3, newDef);

user.addParam(5, newMdef);

// Add the buff state with no duration limit

user.addBuff(3, -1);

user.addBuff(5, -1);

</Custom Apply Effect>

<Help Description>

Buff defense once

</Help Description>

Hit/Evade Increase:

Spoiler: Hit/Evade Increase
<Custom Apply Effect>

// Set the variable rate to 1.1 to increase hit rate, evasion, agility, and luck by 10%

var rate = 1.1;

// Calculate the new hit rate value

var newHit = Math.floor(user.hit * rate);

// Calculate the new evasion value

var newEva = Math.floor(user.eva * rate);

// Calculate the new agility value

var newAgi = Math.floor(user.agi * rate);

// Calculate the new luck value

var newLuck = Math.floor(user.luk * rate);

// Set the buffed hit rate, evasion, agility, and luck values

user.addParam(6, newHit);

user.addParam(7, newEva);

user.addParam(8, newAgi);

user.addParam(10, newLuck);

// Add the buff state with no duration limit

user.addBuff(6, -1);

user.addBuff(7, -1);

user.addBuff(8, -1);

user.addBuff(10, -1);

</Custom Apply Effect>

<Help Description>

Buff hit/evade once

</Help Description>

Health Increase:
Spoiler: Health Increase
<Custom Apply Effect>
// Get the current value of the player's maximum HP
var maxHp = user.mhp;
// Calculate the amount to increase the player's maximum HP by
var increaseAmount = Math.round(maxHp * 0.1);
// Increase the player's maximum HP by the calculated amount
user.addParam(0, increaseAmount);
</Custom Apply Effect>
<Custom Remove Effect>
// Get the current value of the player's maximum HP
var maxHp = user.mhp;
// Calculate the amount to decrease the player's maximum HP by
var decreaseAmount = Math.round(maxHp * 0.1);
// Decrease the player's maximum HP by the calculated amount
user.addParam(0, -decreaseAmount);
</Custom Remove Effect>
<Custom Turn End Effect>
// This effect is designed to last for unlimited turns, so there is no need for any action here.
</Custom Turn End Effect>
<Help Description>
+10% max HP
</Help Description>

Offense Decrease:

Spoiler: Offense Decrease
<Custom Apply Effect>

user._attack *= 0.9;

user.refresh();

</Custom Apply Effect>



<Custom Remove Effect>

user._attack /= 0.9;

user.refresh();

</Custom Remove Effect>

Magic Attack Decrease:


Spoiler: Magic Attack Decrease
<Custom Apply Effect>

user._mat *= 0.9;

user.refresh();

</Custom Apply Effect>



<Custom Remove Effect>

user._mat /= 0.9;

user.refresh();

</Custom Remove Effect>

Defense Decrease:

Spoiler: Defense Decrease
<Custom Apply Effect>

user._def *= 0.9;

user._mdef *= 0.9;

user.refresh();

</Custom Apply Effect>



<Custom Remove Effect>

user._def /= 0.9;

user._mdef /= 0.9;

user.refresh();

</Custom Remove Effect>


Hit/Evade Decrease:

Spoiler: Hit/Evade Decrease
<Custom Apply Effect>

user._hit *= 0.9;

user._eva *= 0.9;

user._agi *= 0.9;

user._luck *= 0.9;

user.refresh();

</Custom Apply Effect>



<Custom Remove Effect>

user._hit /= 0.9;

user._eva /= 0.9;

user._agi /= 0.9;

user._luck /= 0.9;

user.refresh();

</Custom Remove Effect>

NEW
Blood Ritual

I present on to you all, a Situational State called Blood Ritual, (no actual rituals will happen in game)
this skill will max out the Users stats, HOWEVER, The User will be reduced to 1 HP leaving them open to be knocked down in one hit if targeted.

Spoiler: Blood Ritual
<Custom Apply Effect>
var maxValue = 9999; // change this to the max stat value in your game
user._atk = maxValue;
user._def = maxValue;
user._mat = maxValue;
user._mdf = maxValue;
user._agi = maxValue;
user._luck = maxValue;
user._hit = maxValue;
user._eva = maxValue;
user._cri = 1.0;
user._hp = 1;
user.refresh();
</Custom Apply Effect>

<Custom Remove Effect>
user.refresh();
</Custom Remove Effect>

Origin: (Shin Megami Tensei IV/ Shin Megami Tensei IV Apocalypse) [Nintendo 3DS]



Please let me know if these work in your games, if not I'll make sure I fix them on my free time, You are free to edit these to work for your liking!

Update:
During some testing in the afternoon I discovered a few oddities with my State scripts I probably should've tested them more thoroughly but it's fine I fixed them.. well, changed how they work and got rid of One that kept giving me the most problems being the Smirk effect which almost made my Project unplayable so I won't be messing with that anymore until I figure out a Work-Around, but until then, here's a Fix for one of my States and a few new ones with updated information.
Yanfly tips and tricks 2.0 ??
yeah, I used the Tips And Tricks page as reference, I'm still learning so the states might not be perfect.
Just a suggestion, instead of attaching text files that people have to download individually, you could embed CODE tags inside of SPOILER tags. That would also let you maintain correct indentation and such.

Example:
Spoiler: Lord of Clouds
Code:
<Custom React Effect>
// Restore the user's MP by 5% at the start of each turn
var mpRestore = Math.floor(user.mmp * 0.05);
user.gainMp(mpRestore);
// Display the message "MP Restored!" when the MP is restored
BattleManager._logWindow.displayActionResults(user, $dataStates[this.id]);
// Apply the barrier effect to the party for one turn
var barrierTurns = 1;
var barrier = {
    name: "Barrier",
    icon: 123, // Replace with the desired icon ID
    guard: true, // Set guard to true to repel all magic attacks
    turns: barrierTurns
};
$gameParty.members().forEach(function(member) {
    member.addState(123); // Replace 123 with the ID of the state that represents the Barrier effect
});
// Display the message "Party is protected by Barrier!" when the barrier is applied
BattleManager._logWindow.displayActionResults(user, $dataStates[this.id]);
</Custom React Effect>

Thanks for sharing.
This is quite interesting, I wonder, do you think it's possible to create something like 'mortal immortality'?

For example, a state that prevents the character from falling into a state of death for five turns, but if they do not withdraw before the end of the fifth turn, then the character's HP drops to 0 and the state of death is applied.
This is quite interesting, I wonder, do you think it's possible to create something like 'mortal immortality'?

For example, a state that prevents the character from falling into a state of death for five turns, but if they do not withdraw before the end of the fifth turn, then the character's HP drops to 0 and the state of death is applied.
Might I ask what you mean by "withdraw"?
Might I ask what you mean by "withdraw"?
I apologize, the Spanish-English translator may not have conveyed it correctly.What I mean is the following:

- The player uses a skill/consumes an item that causes the status of "Mortal Immortality."
- For five turns, the character affected by the status cannot lose HP.
- If at the end of the fifth turn, the character is still affected by the altered status, their HP is reduced to 0 and their status changes to "Incapacitated"/"Dead."
I apologize, the Spanish-English translator may not have conveyed it correctly.What I mean is the following:

- The player uses a skill/consumes an item that causes the status of "Mortal Immortality."
- For five turns, the character affected by the status cannot lose HP.
- If at the end of the fifth turn, the character is still affected by the altered status, their HP is reduced to 0 and their status changes to "Incapacitated"/"Dead."

<Custom Leave Effect>

user.die();

user.performCollapse();

</Custom Leave Effect>

Please be sure to execute "user.perform Collapse();" to avoid errors.

Using <Custom Leave Effect> will only activate when the status is automatically removed at the end of the turn, not when it is removed by other means.

Selecting "Immune to Status 1" in the trait section will ensure that the player survives even when their HP is at 0.

Original thread: https://forums.rpgmakerweb.com/threads/custom-status-effects-passives-idk-if-i-posted-in-the-right-place.157175/