m not clear how it works, but I believe nicotine
affects the serotonin in
your brain, so when you quit or smoke less
your serotonin level decreases. This can cause anger, anxiety, etc.
Further, anti-depressants are called selective serotonin re-uptake inhibitors (SSRIs). SSRIs are also used to treat anxiety. Perhaps decreasing your serotonin by smoking less caused your anxiety to increase, resulting in panic attacks.