If a mortgage is reduced, the bank would have a loss to write off. But the owner would still own the property.
If a property is foreclosed and sold, the bank would often have a loss to write off. But that doesn't affect the new owner.