Conditional Effects


This script allows you to assign custom conditions to skill or item effects.
Effects are only executed if they meet the conditions.

Conditions are specified as a formula, so you can create any condition that you can think of as long as you can write it.


Script: download here


Place this script below Materials and above Main


To specify a condition for an effect, note-tag skills or items with

<effect condition: ID>
</effect condition>

Where the ID is the ID of the effect that you want to assign the condition to.
You can determine an effect’s ID by counting their position on the list,
so the first effect has ID 1, second effect has ID 2, and so on.


As a shortcut, you can assign a condition to multiple effects by specifying
multiple ID’s separated by commas like this

<effect condition: 1,2,3>
</effect condition>

The formula can be anything that returns true or false.
The following formula variables are available

a - user of the action
b - target of the action
i - item used
t - game troop
p - game party
s - game switches
v - game variables

The formula is evaluated within the context of the effect, so any of the
effect’s attributes can be referenced as well (eg: data_id, code)


Common events are not subject to conditions, because they are handled differently. If you require conditions for your common events, you can use Formula Effects and then call the common event using that


You may also like...

32 Responses

  1. Wiccan Love says:

    If you wish for to get a great deal from this post then you
    have to apply such strrategies to your won blog.

  2. Allen says:

    Does this allow for multiple conditions in one note tag? Ex:

    </effect condition>

    </effect condition>

    • Hime says:

      Use logical operators. For example to require both conditions A and B, you would use
      A && B

      for A or B, you would use
      A || B

      You can have any number of logical operators.

  3. FreezeKirby says:

    Hello yet again, Hime!

    My apologies for actually asking so much in such short time-but after you linked this script to your response, I checked it out-and now I’m wondering if you can help me out in finding a solution to this Skill Mechanic I tried to make. Here is the case!


    The skill, when cast, applies a state on the Caster. The state buffs the affected Battler’s Physical Attack and Critical Rate-but it is meant to possess a secondary-and downside-y effect. What I would like for the buff to do is simple: I would like it to drain the battler’s MP, but if said battler’s MP reach zero, the state disappears.

    The question is, how would I go about doing that? This script seems ideal, but I am not sure about how I am supposed to properly tag the state, unless the Conditional Effects script does not work on states. (Although my first guess was that it worked on states as well.) I have tried with Yanfly’s Lunatic States script, but what I received was a quite significant failure. Would I have to add, in the State’s effects, the MP Drainage, or the removal of the state? Or, would this script not work on states at all?

    Thank you for your time and for the help once more, Hime!

    • Hime says:

      Conditional effects allows you to specify whether an effect should be applied or not. "Effect" refers to the objects in the "Effects" box that items and skills have, and not the general definition of effect. States do not have the effects that items/skills have.

      What you can do is have an event that runs at the beginning or end of every turn that goes through all of the battlers and if they have that state, deduct MP, and remove state if MP is zero.

      Yanfly has a script that allows you to run the same event in every battle.

      If you would prefer a scripted solution, you may need to find a different script that will allow you to specify things that will happen every turn when a state is active.

      • FreezeKirby says:

        I found it, and the whole mechanic works! Phew, that is one heck of a life saver! Thank you again for enlightening me, Hime!

        … Except, uhm, I have one small problem left. X’D…

        I added the checks and the MP Drainage all in a single script call that processes at the end of every single turn, but it’s returning me a decimal result. Here is the script call.

        if $game_actors[10].mp == 0
        actor = $game_actors[10]
        $game_actors[10].mp *= 0.9

        Should I be phrasing it in a better way? Or is there a way to round up the amount?

        • FreezeKirby says:

          … Quoting Xypher: “Blogs need a post Edit feature.” (Or maybe I’m just being a derp.)
          Problem solved, I just had to use a slightly longer formula… Thank you again for the replies, Hime!

        • Hime says:

          You can turn convert it to an integer, which will truncate the value.

          ($game_actors[10].mp *= 0.9).to_i

          If you want to round up you can use round instead.

  4. Lnik3500 says:

    Hi , sorry for the bother but is there a way to use the tag manager with this ? If so , what do I use?

    • Hime says:

      The Tag Manager provides ways for you to check if a tag exists on an object.

      For example, if you wanted to check if the target has the tag “special”, you can use the formula

  5. Tsakhi says:

    I have a question for you. Say I wanted to make a state when an ally’s HP is below 25% call it critical. How would I go about doing that? I re-read the guide and I’m still having trouble, I apologize for such a newbie question

    • Hime says:

      This script would not be suitable to accomplish what you want, although it may be possible to do so.
      Effects are applied when you use an item or skill. If your skills adds a state and you want the state to be added only when the battler’s HP is 25% or under, the formula

      b.hp <= b.mhp * 0.25

      However, if you want the state to be added automatically whenever HP goes below 25%, you would need a way to always use a skill on an actor.

      Which is why it would be better to find a script that will constantly monitor the battler's HP.

  6. Alex says:

    Hello again.
    Another silly question.
    Is there a way to use this script to have an effect if the target have a weakness to an element.
    Is there a formula for element rates? Like element rate over 150%?

    • Hime says:

      Yes, you can say


      Which will return the element rate of the specified element for the target. 1 is normal, 0.5 means it takes 50% damage from that element, 1.5 means it takes 150% damage.

  7. Alex says:


    I’d like to have an effect active only when the skill also add a state.

    For exemple, a skill which inflicts blind but only if it also inflicts poison.

    I can’t figure the formula for this.
    I guess it have to do with b.result but tries like:
    b.result == state (2)
    Doesn’t work. Seems it’s more complicated.

  8. Ctelin Ajira says:

    I am trying to make status spells affected by magic evasion, but not magic reflection. So I tried this notetag setup

    <effect condition: 1>
    c = rand(100000) / 100000.0; c.to_f >= b.mev
    </effect condition>

    It seems to have no effect, despite. I would appreciate some help with this.

  9. rubydragon44 says:

    How would I have it so that the effect will be applied if the result is Critical?
    Something like
    Add state Bleeding

    <effect condition: 1>
    a.weapons.include?($data_weapons[19..25]) && @result.critical?
    </effect condition>
    Or does this script not able to access whether or not the result is critical?

  10. Shiori4me says:

    Omg. I love this! This would work so well for basing dealing say Stun on say Stun on Weight, Attack, Defense…

  1. August 10, 2014

    […] Conditional Effects, or […]

Leave a Reply

Your email address will not be published. Required fields are marked *