Sounds like the simplest solution is adding another key to the ammoValues table called ammo which represents the current ammo in that magazine. When loading that magazine, read from that key instead of the magCapacity key.
self.ammo[self.wepName] = values.ammoValues.ammo
Of course, when switching away from that magazine, you’ll also need to set that value. Dunno where that happens in your code, but it would look like the inverse operation: