oasis-b

Docs / Skills and states

LW_StateRules

Skills and states
RPG Maker MV and MZ state rules and buff stacking plugin

Turns and counters on state icons, higher buff stacks, reapply rules and state code at twenty points of a battle.

Battle Essentials ($9.99)Full Collection ($19.99)

Needs LW_Core (LWZ_Core in MZ) above all Living World plugins in the Plugin Manager. It's included in every pack.

LW_StateRules in a test project

States and buffs with turns, stacks and their own rules.

Highlights

Ideas for your game

Works well with

LW_StateVisualsLW_DamageOverTimeLW_Passives

Introduction

Requires LW_Core.

A poison that shows 3 on its icon, a rage state that counts stacks, an attack buff that goes up to +200%, a shield that breaks after two hits and tells its caster: states and buffs get turns on their icons, counters, more stacks and code that runs at the moment you choose.

Turns and counters are drawn on the icons in every window. With "Turns On Sprites" they are drawn on the icon above enemies too, and above actors when LW_StateVisuals shows actor icons.

Notetags (Actor, Class, Weapon, Armor, State, Enemy)

<LW Max ATK Buff: +2>        two more buff stacks for this stat
<LW Max DEF Debuff: +1>      one more debuff stack
    stats: MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK

State Notetags

<LW Reapply: Keep>           Keep, Reset or Add turns when added again
<LW Show Turns>  <LW Hide Turns>
<LW Turn Alignment: left>    <LW Turn Font Size: 14>
<LW Turn Offset: +2, -2>     <LW Turn Color: 3>
<LW Counter Alignment: center>   <LW Counter Font Size: 14>
<LW Counter Offset: 0, +4>   <LW Counter Color: 6>

Code that runs at a moment of the battle. a, user and target are the one who has the state, origin is the one who gave it, state is the state, s(n) and v(n) read switches and variables:

<LW Apply Effect>            when the state is added
<LW Remove Effect>           when it is removed for any reason
<LW Leave Effect>            when its turns run out
<LW Turn Start Effect>       <LW Turn End Effect>
<LW Regenerate Effect>       before HP, MP and TP regenerate
<LW Action Start Effect>     <LW Action End Effect>
<LW Battle Effect>           at the start of battle
<LW Victory Effect>  <LW Escape Effect>  <LW Defeat Effect>
<LW Apply Effect>
target.setStateCounter(state.id, 2);
</LW Apply Effect>

Code around an action. a, attacker and user act, b, defender and target are hit, value is the damage where it is named and can be changed:

on the attacker's states    on the target's states
<LW Initiate Effect>        <LW Select Effect>
<LW Confirm Effect> value   <LW React Effect> value
<LW Establish Effect> value <LW Respond Effect> value
<LW Conclude Effect>        <LW Deselect Effect>

Order: Initiate, Select, and on a hit Confirm, React, damage, Respond, Establish. Deselect and Conclude always come last.

<LW React Effect>
if (value > 0) {
  value = 0;
  target.addStateCounter(state.id, -1);
  if (target.getStateCounter(state.id) <= 0) target.removeState(state.id);
}
</LW React Effect>

Skill and Item Notetags (on the targets hit)

<LW ATK Buff Turns: +2>      <LW DEF Debuff Turns: -1>
<LW State 5 Turns: +2>       <LW State Poison Turns: -1>
<LW ATK Buff Turn Code>
turn += 1;
</LW ATK Buff Turn Code>
<LW State 5 Turn Code>
turn = 3;
</LW State 5 Turn Code>

When the turns fall to 0, the state or buff is gone.

Script Calls

battler.setStateCounter(stateId, value)
battler.addStateCounter(stateId, amount)
battler.clampStateCounter(stateId, min, max)
battler.removeStateCounter(stateId)
battler.getStateCounter(stateId)
battler.clearStateCounters()
battler.stateOrigin(stateId)       who gave the state, or the battler

A counter can be a number or a short text. It is removed with its state.

Terms of Use

See TERMS_OF_USE.txt in the download. Short version: use it in as many of your own games as you like, free or commercial. Edit it for your game, but keep this header. Don't share or resell the plugin files on their own. Name oasis-b in the credits of your game.

Changelog

Version 1.0.0 - 2026-11-21 - First release.

Introduction

Requires LWZ_Core.

A poison that shows 3 on its icon, a rage state that counts stacks, an attack buff that goes up to +200%, a shield that breaks after two hits and tells its caster: states and buffs get turns on their icons, counters, more stacks and code that runs at the moment you choose.

Turns and counters are drawn on the icons in every window. With "Turns On Sprites" they are drawn on the icon above enemies too, and above actors when LWZ_StateVisuals shows actor icons.

Notetags (Actor, Class, Weapon, Armor, State, Enemy)

<LW Max ATK Buff: +2>        two more buff stacks for this stat
<LW Max DEF Debuff: +1>      one more debuff stack
    stats: MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK

State Notetags

<LW Reapply: Keep>           Keep, Reset or Add turns when added again
<LW Show Turns>  <LW Hide Turns>
<LW Turn Alignment: left>    <LW Turn Font Size: 14>
<LW Turn Offset: +2, -2>     <LW Turn Color: 3>
<LW Counter Alignment: center>   <LW Counter Font Size: 14>
<LW Counter Offset: 0, +4>   <LW Counter Color: 6>

Code that runs at a moment of the battle. a, user and target are the one who has the state, origin is the one who gave it, state is the state, s(n) and v(n) read switches and variables:

<LW Apply Effect>            when the state is added
<LW Remove Effect>           when it is removed for any reason
<LW Leave Effect>            when its turns run out
<LW Turn Start Effect>       <LW Turn End Effect>
<LW Regenerate Effect>       before HP, MP and TP regenerate
<LW Action Start Effect>     <LW Action End Effect>
<LW Battle Effect>           at the start of battle
<LW Victory Effect>  <LW Escape Effect>  <LW Defeat Effect>
<LW Apply Effect>
target.setStateCounter(state.id, 2);
</LW Apply Effect>

Code around an action. a, attacker and user act, b, defender and target are hit, value is the damage where it is named and can be changed:

on the attacker's states    on the target's states
<LW Initiate Effect>        <LW Select Effect>
<LW Confirm Effect> value   <LW React Effect> value
<LW Establish Effect> value <LW Respond Effect> value
<LW Conclude Effect>        <LW Deselect Effect>

Order: Initiate, Select, and on a hit Confirm, React, damage, Respond, Establish. Deselect and Conclude always come last.

<LW React Effect>
if (value > 0) {
  value = 0;
  target.addStateCounter(state.id, -1);
  if (target.getStateCounter(state.id) <= 0) target.removeState(state.id);
}
</LW React Effect>

Skill and Item Notetags (on the targets hit)

<LW ATK Buff Turns: +2>      <LW DEF Debuff Turns: -1>
<LW State 5 Turns: +2>       <LW State Poison Turns: -1>
<LW ATK Buff Turn Code>
turn += 1;
</LW ATK Buff Turn Code>
<LW State 5 Turn Code>
turn = 3;
</LW State 5 Turn Code>

When the turns fall to 0, the state or buff is gone.

Script Calls

battler.setStateCounter(stateId, value)
battler.addStateCounter(stateId, amount)
battler.clampStateCounter(stateId, min, max)
battler.removeStateCounter(stateId)
battler.getStateCounter(stateId)
battler.clearStateCounters()
battler.stateOrigin(stateId)       who gave the state, or the battler

A counter can be a number or a short text. It is removed with its state.

Terms of Use

See TERMS_OF_USE.txt in the download. Short version: use it in as many of your own games as you like, free or commercial. Edit it for your game, but keep this header. Don't share or resell the plugin files on their own. Name oasis-b in the credits of your game.

Changelog

Version 1.0.0 - First release for MZ.

Get it

LW_StateRules is in these packs. Every pack comes as an MV and an MZ download at the same price and needs no other plugin collection. Tested in RPG Maker MV 1.6.2 and MZ 1.10.0 games on Windows, macOS and Linux and in current browsers.

Battle Essentials ($9.99)Full Collection ($19.99)
← LW_ElementRulesLW_StateVisuals →