Get max ammo capacity in hud equipped item view model

Hello everyone,
is there a way to get the max ammo capacity in the equipped item view model so you can design a bar which schows the remaining ammo? I do not mean ammo surplus but the max number that fits in one magazine if the gun has one. If so can you please tell me how?
Otherwise this would be a great addition to the feature set of view models!
Thank you and maybe consider liking this post so the feature gets implemented.