Electroconvulsive therapy (ECT) is most commonly used today for patients diagnosed with: