Venlaflaxine - the medication you are treated with ( Veniz xr 75) is an anti-depressant preferred for younger generation as it is more compatible and doesn't effect sexual desire/libido.
This is not meant for the anxiety disorder alone however a compulsion to masturbate in itself describes a reduction in threshold for frustration. You do feel irritable and lack motivation because of the depressive Episode.
The drug itself takes a few weeks to take its full effect on depression and anxiety.
The thought process that causes compulsive masturbation is important to target.
Next Steps
Complete the prescribed course and follow up with your doctor(consultant) for any persistent symptoms and start with counselling sessions.
Health Tips
ventilate your emotions and use the pent up energy to boost your motivation.