I have good knowledge of this topic having a background in psychology and having experience panic attacks myself.
First off panic attacks are defenitely hereditary. It's likely that AAS use brought on your first panic attack. The problem is once you've had one you're very prone to having more. It's almost like the fear of having one is constantly looming which kind of makes you more vulenerable. Ironically it's the fear of panic attacks which cause future panic attacks. So what's the cure? Unfortunately there isn't one but it's very very treatable. Learn some relaxation techniques (take a meditation class..panic attacks are very physiological..meditation teaches you how to treat these physical symptoms of panic and works alot better then meds to treat panic attacks in my opinion). Also just carrying some xanax/klonopin/valium in your pocket with you. This always seemed to help me (the realization that I had something readily availalbe to treat panic attacks in my pocket..this reduced my fear of having one and pretty much has elimentated my attacks).
Ask your doctor about klonopin wafers. They're very fast acting (within 10 minutes), unlike traditional pills.