How are stat-up moves calculated by the engine?
I'm told one stage is worth 50%, but what about when 2 of them are there? Is it +125% or +100%?
Think of it like this. Start with 2/2. If you are raising stats, add however many boosts it has to the top number. For instance, after 3 boosts, you get (2+3)/2, which is 5/2. Multiply this by your original stat. If you are decreasing, add 1 to the bottom 2 for each decrease. For instance, if you are at -3 Defense, you will have 2/(2+3), or 2/5. Multiply this by your original Defense.
This works out nicely to +50%, +100%, +150%, etc. up to +300% (or x1.5, x2, x2.5, etc. up to x4) for stat increases, but for decreases, it's x.67, x.5, x.4, so there is no obvious linear progression like increases.