The effects under the items tab has a buff and debuff category, I'm trying to understand how the wear off code is executed
and as far as I'm able to look I didn't find anything! What I mean is should the buffs stop after x turns!? where does RMMV uses this data effect.value2 is never used...
The duration of a state will be within the specified range (min to max), and is used in resetStateTurns() in Game_BattlerBase. In the database, the minimum duration is the leftmost number, and maximum is the rightmost number. If the minimum turn length is greater than or equal to the maximum turn length, the turn length will always be equal to the minimum. These values are available for any state data, named minTurns and maxTurns respectively.
For state removals by duration, this happens within removeStatesAuto(timing) where the timing is either 1 or 2 (where 0 means there is no duration applied to this state). States will only be removed this way if their duration has ended, which is checked through the function isStateExpired(stateId).
I hope this answered your questions.