Problems with experience formula

So I wanted a completely different experience formula than RPG maker MV uses by default so I made this based on RPG Maker XP:

return Math.round(basis*(Math.pow(level+3, (2.4+extra/100)))/(Math.pow(5, (2.4+extra/100))));

In our case basis = 25, and extra = 35, and level equals the players current level. Math.pow is just calculating an exponent so for example Math.pow(3, 2) = 9. Math.round just rounds it to the nearest whole number.

The formula works just like I want it to except it determines the total experience and I want it to determine the experience just for the next level.

For example leveling up from 2 to 3(you put 3 in as the value for level) the formula returns the amount 41. I wanted 41 to be the amount of experience it takes to reach level 3.

But instead, it uses 41 as the total experience you need to reach level 3 in addition to the experience you had before. So you already have 25 exp from the previous level so it takes 16 to reach level 3. I want it to be 41.

Does anyone know how to do this? Sorry I tried to explain myself as best as I could but it's not easy explaining math 😛.

Original thread: https://forums.rpgmakerweb.com/threads/problems-with-experience-formula.78877/