My wife has cancer, I could lose my job

Hi 

My wife was sadly diagnosed with breast cancer back in May of this year. As with any news like this it hit us hard at first, but we've tried to remain positive that the treatment will work.

Personally though, I've suffered for many years with anxiety and depression and I'm on medication for this which is fine. I started a new job at the beginning of this year and they had been quite understanding, although I really believe the manager isn't very good at being supportive.

Over the last couple of months I've struggled at work with simple systems and forgetting things. I'm not sure if this is due to my own mental state and also what is going on at home with my poorly wife. At home we have 2 small children who are cared for through the day when I work, when I get home, it's all hands to the deck to care for my wife and the kids too. 
So I don't know if I'm just overly exhausted as well.

thing is, I was pulled into a meeting with my manager last week who railed at me for oversights in my work. She threatened me with going to HR about it and told me it can't be to do with what's going on at home. Basically suggesting I guess that I'm just incapable of the job.

when I first heard of the news back May, my work went down hill and I was put on a performance plan by the manager. She now states she was going to put me on this anyway and before I heard the news. I don't believe this.

For all my own, I suppose mental health, I do work hard, I turn up and dilligently get on with the job. I actually enjoy what I do. Perhaps I'm paranoid, but maybe the manager just doesn't like me as a person. 
anyway, top and bottom. I feel like I'm going to be getting the bullet anytime now over a lack of understanding of a system they use.

how do I appeal? What can I say to HR in my defence?

its a really worrying time. I'm trying to care for my wife and family by doing all that I can at home and keeping a roof over our heads.

any help and suggestion would be most welcome.