I can't do my variable math correctly

Hallo everyone, hope you're all doing well.

So, I'm currently trying to add a item that can stock pieces of slime and this item only fits 20 pieces of slime simultaneously.
What I'm having trouble to do is that so when you try to put the Slimes inside the item it will try to stock all of the piecesyou have, but will store only the amount that fits inside the item.

So I created the variables 3(the amount of slimes already stored in the item), 6(the total avaliable space in the item), 7(the total of slimes that the player have) and 8(the result of the space avaliable minus the amount of slimes the player have)

Here are the screenshots of the event:
1st-Screenshot.png
2nd-Screenshot.png


Almost forgot hehe

Informations about this Example:
Total amount o pieces a glass can hold: 20
Already stored in the glass: 10
Amount I have in the inventory: 20
Expected result: store 10 Slimes and letf 10 off
Result I'm getting: all the slimes were stored, but the variable Current Blue Slime Stocked have gone tto 40??? what?
It looks to me like currently it's:

V6 Blue Glass Space = 20
V6 Blue Glass Space -10 // == 10

V7 Amount of Slimes = 20

V8 Difference = V6 // == 10
V8 Difference - V7 // => 10 - 20 = -10

The conditional else triggered (because negative)

V7 Amount of Slimes - V8 // => 20 - (-10) = 30
V3 Current Blue Slime Stocked + V7 // => 10 + 30 = 40
So the problem is that I was subtracting a negative value when I should have been adding it. Understood, I'll try to fix it as soon as I get home and I'll get back to you and let you know if it worked (it probably will)
It worked.
Helped me a lot. Now I can continue my little game with no worries. Thank you rpgLord 😀

Original thread: https://forums.rpgmakerweb.com/threads/i-cant-do-my-variable-math-correctly.168327/