; and (iii) one of the exempt purposes of such organization includes the fostering of middle-income housing. (D) Treatment of certain subsidiaries (i) In general For purposes of this paragraph, a qualified nonprofit organization shall be treated as satisfying the ownership and material participation test of subparagraph (B) if any qualified corporation in which such organization holds stock satisfies such test. (ii) Qualified corporation For purposes of clause (i), the term qualified corporation means any corporation if 100 percent of the stock of such corporation is held by 1 or more qualified nonprofit organizations at all times during the period such corporation is in existence. (E) State may not override set-aside Nothing in subparagraph (E) of paragraph (3) shall be construed to permit a State not to comply with subparagraph (A) of this paragraph. (5) Buildings eligible for credit only if minimum long-term commitment to middle-income housing (A) In general No credit shall be allowed by reason of this section with respect to any building for the taxable year unless an extended middle-income housing commitment is in effect as of the end of such taxable year. (B) Extended middle-income housing commitment For purposes of this paragraph, the term extended middle-income housing commitment means any agreement between the taxpayer and the housing credit agency— (i) which requires that the applicable fraction (as defined in subsection (c)(1)) for the building for each taxable year in the extended use period will not be less than the applicable fraction specified in such agreement and which prohibits the actions described in subclauses (I) and (II) of subparagraph (E)(ii), (ii) which allows individuals who meet the income limitation applicable to the building under subsection (g) (whether prospective, present, or former occupants of the building) the right to enforce in any State court the requirement and prohibitions of clause (i), (iii) which prohibits the disposition to any person of any portion of the building to