given to refinance an existing mortgage insured under this chapter, or an existing mortgage held by the Secretary that is subject to a mortgage restructuring and rental assistance sufficiency plan pursuant to the Multifamily Assisted Housing Reform and Affordability Act of 1997 ( 42 U.S.C. 1437f note), provided that—
(A) the principal amount of any such refinancing mortgage shall not exceed the original principal amount or the unexpired term of such existing mortgage and shall bear interest at such rate as may be agreed upon by the mortgagor and the mortgagee, except that (i) the principal amount of any such refinancing mortgage may equal the outstanding balance of an existing mortgage insured pursuant to section 1715z–10 1 1 See References in Text note below. of this title, if the amount of the monthly payment due under the refinancing mortgage is less than that due under the existing mortgage for the month in which the refinancing mortgage is executed; (ii) a mortgagee may not require a minimum principal amount to be outstanding on the loan secured by the existing mortgage; (iii) in any case involving the refinancing of a loan in which the Secretary determines that the insurance of a mortgage for an additional term will inure to the benefit of the applicable insurance fund, taking into consideration the outstanding insurance liability under the existing insured mortgage, such refinancing mortgage may have a term not more than twelve years in excess of the unexpired term of such existing insured mortgage; and (iv) any multifamily mortgage that is refinanced under this paragraph shall be documented through amendments to the existing insurance contract and shall not be structured through the provisions of a new insurance contract; and
(B) a mortgage of the character described in paragraphs (1) through (6) of this subsection shall have a maturity and a principal obligation not in excess of the maximums prescribed under the applicable section or subchapter of this chapter, except that in no case may the principal obligation of a mortgage referred to in paragraph (5) of this subsection exceed 90 per centum of the appraised value of the mortgaged property, and shall bear interest at such rate as may be agreed upon by the mortgagor and the mortgagee;
(C) a mortgage that is subject to a mortgage restructuring and rental assistance sufficiency plan pursuant to the Multifamily Assisted Housing Reform and Affordability Act of 1997 ( 42 U.S.C. 1437f note) and is refinanced under this paragraph may have a term of not more than 30 years; or