Hi,
Have you spoken to a teacher about how you feel?
Is it the exam itself or does the environment trigger feelings of panic? Maybe a quiet room away from other students would be less stressful, I know accommodations can be made for some ASD students in NI (extra time, time outs, scribe, prompter etc) surely the school or college would allow someone to go with you when you need to leave to de stress for a few minutes? And then come back in with you once you feel calmer?
I think you need to be able to talk to a teacher or lecturer . A lot of people feel like this in exams, I personally had to leave exam halls to throw up because I got so nervous.