Say I have a G4 overcharged FSD and I unlock level 5 and have the mats to roll on a G5 overcharge mod.
Does the potential G5 upgrade add/subtract on to the stats of the already existing mod or does it completely overwrite it?
It completely overwrites it. Also the potential stat increases are still relative to the original stats, not the modified ones.
For example (and note, I am NOT trying to use figures that represent the real stats increases that engineers will offer here, just to explain the way the rolls work) say you had a vanilla FSD that will jump your ship 30LY and you're rolling a mod that includes a potential optimised mass improvement between 10% and 50%.
Forget the effects that the other changed attributes will have, just for simplicity of the example - all of them work the same as this anyway. With a range of possible increases between 10% to 50%, you can expect your FSD range to increase between 3LY (10% of your stock range) and 15LY (50% of your stock range)
Your first roll gives you a 33% increase in optimised mass, which will essentially increase your FSD range by 10LY (33% of 30) to 40LY - you like that and accept it.
Then you roll again. Your next roll
isn't going to give you a range of potential increases between 4LY and 20LY (10% to 50% of 40LY) It will still give you between 10% and 50% of your base (i.e. unmodified) range and whatever you roll will
replace what you already have, not add to it.
You can see that when you look at the sliders - if you check the slider for optimised mass when you're about to do your second roll and compare it to how it looked when you were rolling on the unmodified drive, you would see that there is a red section (bad) which simply wasn't there when you did your first roll because the first roll could not possibly have
decreased your optimised mass value, the worst possible result was a 10%
increase.
Your second roll
can reduce it though because you're rolling to change your stock optimised mass between 10% and 50% but the FSD already has a 33% increase on the stock value. If you roll a 10% 'increase' on your second roll what you have actually done is changed your FSD range to 33LY (10% increase on stock) which is actually a 7LY decrease compared to the 40LY range you had from the first roll.
I can't stress enough how important it is to stop looking at the sliders moving and just look at the numbers on them instead. The numbers before you hit the button to spin show you the ACTUAL minimum value you can get from this roll, the ACTUAL maximum value you can get and the ACTUAL value you have for that attribute at the moment.