I've some experience with panic attacks but none with being terminally ill, so a lot of what I'm saying might be bollocks. But anyway, it looks like you have some breathing exercises and maybe other techniques which is good, but do you have access to any kind of counselling or talk therapy, or something like CBT, maybe from the NHS, or maybe from charities who provide this — maybe even something more specialist like an organisation based around your illness, or maybe local hospices have something? Maybe someone in your care team like a palliative nurse or a doctor might he able to recommend something? There are techniques you can learn which can sometimes quite quickly help you manage panic attacks.
Or you could ask your doctor about medication; there are quite a few drug options, but obviously they'd need to be suited to your medical situation, and while some can help straight away, some of the drug options can take quite a long time to take effect.
I wondered if your terminal illness is also something that you're not able to discuss with the people in your life as much as you might feel you need to, and that's making you feel kind of hemmed in and panicky being alone with all the contingencies and stuff. I might be way off base here, though, and hope I haven't said anything offensive. I just wondered if your brain being in overdrive might be worse because it's got nowhere to get these things out and talk them through with another person. I don't know about your life at all, though — these things might not be true of you at all.
If it's the same things going round and round in your head, it might be worth writing some of these thoughts down and organising them, if you don't already do that. Then next time your brain starts up on them, you can gently remind it that those worries and plans and possibilities are already safely and thoroughly written down somewhere so there's no risk of them being forgotten, and they don't have to take focus.
I wish you the best of luck with the panic attacks, they're truly horrible and really not what you need.