This sounds like a perfect use-case for the Gameplay Ability System (GAS).
The learning curve can be a bit steep at the beginning, but if you allow yourself the time it will pay off in the long run. It’s a system that scales very well when you start adding more content to your game, and supports networking out of the box if that’s something you need.
It’s an Epic Games official plugin that’s used in games like Fortnite and other AAA titles, so pretty much any use-case you come up with will be possible to handle.
From what you’re describing, it sounds like you can create different GameplayAbilities for each weapon. All of them could inherit from a base GameplayAbility where you have the shared functionality (like the input config).
Here are some resources to get you started with GAS:
Official docs: Gameplay Ability System for Unreal Engine | Unreal Engine 5.5 Documentation | Epic Developer Community
Unofficial docs, but I recommend this as an excellent guide and go-to reference document which covers everything: GitHub - tranek/GASDocumentation: My understanding of Unreal Engine 5's GameplayAbilitySystem plugin with a simple multiplayer sample project.
Video tutorial: Getting Started with the Gameplay Ability System (GAS) in Unreal Engine 5.4 | Community tutorial