Hi,
I also have a lot of experience with debilitating depression. I even took a medical leave of absence from my program for all of last year to deal with it.
The two things I have to offer are:
1) go to your school's disability office. Mental illness qualifies under their definition of disability and they can help advocate for you with your department if you need to take time off, reduce your workload, change advisors, etc.
2) Seriously consider a leave of absence for a term or more. Get treatment. Get a drug regimen that works for you. Take some stress off your plate so you can manage your illness.
Hope it all works out.