of subsection (b)) to the taxpayer for any taxable year shall be reduced (but not below zero) by so much of the distributions treated as a qualified higher education expense under section 529(c)(9) with respect to loans of the taxpayer as would be includible in gross income under section 529(c)(3)(A) for such taxable year but for such treatment. . (d) Distributions for certain elementary and secondary school expenses in addition to tuition Section 529(c)(7)(A) of such Code, as amended by subsection (b), is amended to read as follows: (A) expenses described in section 530(b)(3)(A)(i) in connection with enrollment or attendance of a designated beneficiary at an elementary or secondary public, private, or religious school, and . (e) Effective dates The amendments made by this section shall apply to distributions made after December 31, 2018. IV Revenue provisions 401. Modifications of required distribution rules for designated beneficiaries (a) Modification of rules where employee dies before entire distribution (1) In general Section 401(a)(9) of the Internal Revenue Code of 1986 is amended by adding at the end the following new subparagraph: (H) Special rules for certain defined contribution plans In the case of a defined contribution plan, if an employee dies before the distribution of the employee’s entire interest— (i) In general Except in the case of a beneficiary who is not a designated beneficiary, subparagraph (B)(ii)— (I) shall be applied by substituting 10 years for 5 years , and (II) shall apply whether or not distributions of the employee’s interests have begun in accordance with subparagraph (A). (ii) Exception only for eligible designated beneficiaries Subparagraph (B)(iii) shall apply only in the case of an eligible designated beneficiary. (iii) Rules upon death of eligible designated beneficiary If an eligible designated beneficiary dies before the portion of the employee’s interest to which this subparagraph applies is entirely distributed, the exception under clause (iii) shall not apply to any