The discharge of a debt has nothing to do with the timeliness of payments. Discharge of the debt is based on whether or not you qualify for discharge under the bankruptcy code.
When a mortgage servicer or note holder decides to push the loan into foreclosure status, they can refuse the payments unless you pay the demanded amount in full. This is commonly known as acceleration. They have accelerated the payments on your loan which they are entitled to do if you have defaulted on your obligation to them. The acceleration can only be cured by tendering the amount demanded on the foreclosure/default notice or by filing a Chapter 13 bankruptcy and proposing a plan of reorganization. You could also request a loan mod through the mortgage servicer, but the outcome of that is usually less than successful in my experience.
This answer is intended for informational purposes only and no attorney/client relationship is formed by the viewing or reading of the response to the users question. Always seek the advice of competent and legal counsel before engaging in any legal action.