I tend to think of them as too separate entities. Behavior is one, Thoughts are another. To have a panic attack as stated, we didn't have to learn. Although I do believe the lingering thought process of fear of the next one (which can almost be right up there with the panic attack itself) can be unlearned/changed with thinking differently, and the sooner the better. Mine was so many years ago, CBT wasn't an option, medicine was, so my thoughts changed my behavior, no one not even me saw the agoraphobia down the line, when avoidance started. I think if doctors, and I will admit, I needed the medication to calm my body at the beginning had directed me to cognitively rationalizing my fears, I wouldn't have become the agoraphobic that I am today.