Lunatic Damage

Last Updated: 2011.12.22
Download Link
Github Link


Lunatic mode effects have always been a core part of Yanfly Engine scripts. They exist to provide more effects for those who want more power and control for their items, skills, status effects, etc., but the users must be able to add them in themselves.

At first, I thought the need for Lunatic Damage tags would be no longer needed due to RPG Maker VX Ace’s custom damage formula box, but after realizing that it’s limited in size (100 characters max), Lunatic Damage will have to take over if needed.

Lunatic Damage Formulas allows skills and items to use custom damage formulas that allow for more than 100 characters. Use the following notetag to assign the formulas to be used.

<custom damage: string>

The string used will refer to the formula used below. Also, note that through this script, all items and skills will run through this method even if the <custom damage> notetag isn’t used.

“NORMAL FORMULA” will be the formula used if no custom damage formulas are inserted. In addition to that, you may also insert “NORMAL FORMULA” to have the custom damage formula add on the normal damage formula used in “Formula Calculation” within the database editor.

If multiple tags of the custom damage notetags are used in the same skill/item’s notebox, then the calculations will occur in that order. Replace “string” in the tags with the appropriate flag for the method below to search for. Note that unlike the previous versions, these are all upcase.

Should you choose to use multiple lunatic formulas for a single skill or item, you may use these notetags in place of the one shown above.

<custom damage>
</custom damage>

All of the string information in between those two notetags will be stored the same way as the notetags shown before those. There is no difference between using either.


  • Critical Package
    • Attacker HP Crisis, Attacker MP Crisis, Defender HP Crisis, Defender MP Crisis, High TP Critical, Low TP Critical, TP Boost, TP Bonus
  • Power Package
    • Attacker High HP, Attacker High MP, Attacker Low HP, Attacker Low MP, Defender High HP, Defender High MP, Defender Low HP, Defender Low MP
  • Gemini Package
    • Gemini MP, Gemini HP, Gemini Set MP, Gemini Set HP, Gemini Percent MP, Gemini Percent MP, Gemini Eval MP, Gemini Eval HP

Use your Lunatic Damage Formulas wisely.

And that’s all, folks!

28 comments on “Lunatic Damage

  1. I would like to skills that become stronger or weaker with every time they are used. Maybe even a skill that becomes stronger with every turn/round passing. How can I do that?

  2. Question: I’d like to make a formula for a skill that grows stronger if a specific item(s) are equipped.
    Ex: dam = (a.mag * 2 * 1.x) – b.mgd
    where x = 1 if weapon 2 is equipped or 2 if weapon 4 is equipped and 0 if neither.
    Is this possible with this script?
    Would be nice if it could also be done with states, but I’m just looking for weapon modifiers right now.

    Thanks in advance.

    • Have the skill use a variable in its formula and use a common event to change the variable. Best used with Base Troop Events, to reset it at the start, or for the turn counter.

  3. Pingback: Status provocação. | Atelier Cross

  4. Any chance I could have the formula check if target has a state, and deal extra damage. Such as an attack that deals extra damage to stunned targets.

  5. I’m using 3 states (which are gained consecutively by attacking), then you can do an attack, which is stronger, depending on whcih state you are in. Formula:
    a.state?(43) ? 3 : a.state?(42) ? 2 : a.state?(41) ? 1 : 0
    With the normal Database Formula it works fine, but if i use the custom notetag (because i want to replace 3, 2 and 1 with something)

    it fails.
    Is the syntax of the lunatic package different than the normal formulas?

    • {custom damage:a.state?(43) ? 5 : a.state?(42) ? a.atk-b.def : a.state?(41) ? a.atk-b.def : 0} think of the brackets as the correct ones, it seems to trigger something

  6. I’m trying to use a formula that checks if Target1 has State1 and if Actor1 has Skill1 at the same time. I don’t know what I’m doing wrong, but it keeps giving me errors.

    That’s what I have under my “when” stuff.

    value += if b.state?(137) && a.skills.include?($data)skills[142]);(a.atk*2)*1.2-b.def;else;a.atk*2-b.def;end

  7. Whenever the opponent uses the skill, I get this error:
    Script “Lunatic Damage” line 108: TypeError occurred.
    nil can’t be coerced into Fixnum

    The formula in the script looks like this:
    value += a.add_debuff(2, 5); a.add_debuff(3, 5); a.add_debuff(4, 5); a.add_debuff(5, 5); a.add_debuff(6, 5); a.add_debuff(7, 5); 300 + a.atk * 4 – b.def * 2

    My notebox for the skill Eruption says . For damage I set it to HP Damage, element Fire, and left the box blank. Help, please?

  8. Is it possible to increase element damage with this? I saw Yanfly had an element boost script for VX but when I put it in Ace it didn’t work. So say a character has a Fire Ring equipped, I want Fire spells and attacks to do more damage.

  9. Pingback: Holy Strike – ADDON | Alistair Engine

  10. Pingback: State increases received Damage – ADDON | Alistair Engine

  11. Pingback: Heal individually and by stat | Alistair Engine

  12. I am wondering if it’s possible to add a regular damage formula to the script – I’d appreciate it if anyone can help me create a new lunatic damage entry for this.

    b.state?(1) ? b.add_state(2) + b.add_state(3) : b.add_state(2)

  13. This script has worked perfectly when making attacks, but I’m currently trying to make healing potions.

    I want a potion that heals according to this formula:
    (1.5 * (a.def + 150)).to_i

    but it only works when I don’t have this script.

    Is there some way to put this formula into the script as a damage formula so that I can have a healing item?

  14. Is there a means to make a custom accuracy string with any of these pre-made modules, similar to this script does for damage?

    I want to drastically alter the to hit strings, but also want to be able to have some attacks be based off of different stats for accuracy from normal.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s