Finally, a formulae thread. I just need to know how to work with states, like adding or removing, since add_state(n) no longer works in MV.

Never mind, got it now.

For those having this issue, it's

**a.addState(X)** with X being the ID of the state. Replace a. by b. if you want to give the state to the enemy.

<edit>

To remove a state, it's

**a.removeState(X)**.

This is very useful when you want to do something to the target while changing status effects on the user, like a forced crit on the next basic attack. You'd just write

**a.removeState(X); a.atk * 4 - b.def * 2** X being the forced crit state, in the basic attack's damage formula.

For addState, a use you can have is to make an attack that kills the enemy if their HP is below 25%. You'd then write

**if (b.hp<(b.mhp*25/100)) b.addState(1);**
Note that this formula would just display a 0 if the enemy's HP is above that threshold.

</edit>

Anyone know how to generate random numbers in MV?

According to the Damage Formulas 101 I found in a different RPG Maker forum, the formula is

**Math.floor(Math.random()*X)+Y** for a random number between Y and X+Y-1.

**Math.floor(Math.random()*100)+1** returns a number between 1 and 100,

**Math.floor(Math.random()*100)** returns a number between 0 and 99,

**Math.floor(Math.random()*201)+50** returns a number between 50 and 250.

<edit> Even better, there's

**Math.randomInt(X)+Y **for short. </edit>