Code taken from Invisible Hands and Weapons by Dr_Newbie, I just made them toggle separately, and now the states save between restarts.
Made for fantafubuki
If you want to toggle viewmodel on ads instead just use this mod Hide Weapon On ADS.