Silencer On/Off?

What is the code(w/e) for putting silencer on/off for swep bases/sweps?
I want to make an USP swep for myself but i want that when i press for example E+Right Mouse Click, it puts Silencer on to it. And i when i press Ex. E+Right Mouse Click Again, it put’s it away.

I suspect you have to change the viewmodel’s body group or something to get the silencer model visible. Then you’d have to change the gun’s sounds to be silenced.

The code to change between these modes is the easy part. I’ll give an actual answer if I can find out if you can simply run an animation on the view model to get the silencer visible or if you have to do some hacking on top of that.