Max ammo in SWEP

Were would I put a max ammo type thing in a SWEP? I have a code but I don’t know where to put it. Would it work in think? I tried initialize but that’s only activated when the weapon is spawned. Can’t put it in primary fire cuz it would only go off when you shoot. Anyone got ideas?

You need to be more specific. Infinite ammo? Where you set your ammo?

How do I set the maximum amount of ammo my SWEP can have. So say the max was 100. If you obtain more than 100 ammo it would go back to 100. I am unsure where to put the code for this though. Would it be in the Think part?