Resident evil 4 remake has an incredible ammo drop system that scans what ammo is low and has enemies drop that specific ammo, at low quantities. For example, if you have 5 shotgun ammo and idk 20 pistol ammo, even if you use up all 5 shotgun ammo since you have a ton of pistol ammo you will barely get any shotgun drops. But as soon as you hit like 10-5 pistol ammo, shotgun ammo will start dropping. Snipers are OP in most games, like in fnv you can clear NCR correctional from a mountain effortlessly with a sniper - so you will carry around 3-4 bullets max at a time, forcing you to get close and personal. I know this sounds crazy hard to make, but it would turn FNV into true survival game which forces you to use everything you got in your inv.
Specific implementation: Every time you kill an npc, or npc dies in vicinity (doesn't matter if it's human or creature, since if creatures dont drop ammo game over), the game scans your inventory for all possessed ammo and calculates a "weight" variable using a formula, and makes the NPC either - physically drop some ammo on the ground like sonic rings or something idk, or add it to their inventory post mortem (idk if you can even do this, first option sounds easier, just spawn ammo on the ground). The ammo dropped has nothing to do with the type of gun npc is using or if they are even human, but they must only drop ammo for a gun you currently possess in your inventory. Ammo drops in chunks, 1-3-5-10 pistol/smg ammo (depending if it's super low), 1-2 shotgun ammo and 1 sniper ammo per drop. If you have room to get any type of this ammo, pistol/smg ammo should be more common than shotgun>assault rifle>sniper. Storing ammo would be cheating so delete any ammo stored in containers? More powerful weapon ammo like snipers will have a higher "weight". for example, snipers>shotguns>ARs>smg/pistol ammo. (sorry forgot ammo names in game). When you have too much of this weight value, ammo drop rate becomes exponentially lower. I imagine it would be easy to make MCM menu that lets you modify the weight constant per ammo type depending on your tastes. If you feel like idk 4 sniper ammo is too low, you bump the constant down and you can carry around like 10.
Script to remove/significantly reduce merchant ammo.
Example: weight max - 100, sniper constant 20, shotgun constant 10, smg or pistol constant 1. lets say you got 5 sniper ammo. Weight becomes 20*5=100, so you get super low, around 1% chance for any other ammo drop. so with this formula, to have high chance for drops (can be set in mcm, lets just say by default 60%) you must have 4 sniper ammo (80), 1 shotgun ammo (10) and (9 pistol/smg ammo). Since your weight variable is 99, and giving player sniper ammo will put it to 119, you will have a much higher chance to get pistol ammo, but a higher chance of 1-2 bullets dropping than 5 or 10. Lets say you have 80 weight constant. You have higher chance to get 10 pistol/smg ammo than 1 sniper ammo, since we established pistol has higher chance to drop than shotgun than assault rifle than sniper
For the beginning ignore modded gun ammo and just focus on vanilla ammo.
In game example: Imagine you are hitting NCR correctional with AMR. You have 3 shots, take out 3 guys easily. Now you have no sniper ammo, and good luck hitting anything with assault rifles with recoil mods installed. So you are forced to get close, and use stealth to kill enemies from close up, or collect more ammo from their corpses. On top of that, miss too much and run out of ammo, and you will have to attempt to recover ammo from your fallen enemies while avoiding all the incoming bullets.