Modification is purely at the discretion of the lender. If they choose not to come to new terms they will still foreclose if you are in default. In fact, the foreclosure process may not be affected by the pending modification negotiations. Lots of people get foreclosed upon who were pursuing modification.