(f) Determination of tax liability (1) In general If, for any taxable year, any amount is excluded from gross income of a taxpayer under subsection (a), then, notwithstanding section 1, if such taxpayer has taxable income for such taxable year, the tax imposed by section 1 for such taxable year shall be equal to the excess (if any) of— (A) the tax which would be imposed by section 1 for such taxable year if the taxpayer’s taxable income were increased by the amount excluded under subsection (a) for such taxable year, over (B) the tax which would be imposed by section 1 for such taxable year if the taxpayer’s taxable income were equal to the amount excluded under subsection (a) for such taxable year. For purposes of this paragraph, the amount excluded under subsection (a) shall be reduced by the aggregate amount of any deductions or exclusions disallowed under subsection (d)(6) with respect to such excluded amount. (2) Treatment of capital gain excess (A) In general In applying section 1(h) for purposes of determining the tax under paragraph (1)(A) for any taxable year in which, without regard to this subsection, the taxpayer’s net capital gain exceeds taxable income (hereafter in this subparagraph referred to as the capital gain excess)— (i) the taxpayer’s net capital gain (determined without regard to section 1(h)(11)) shall be reduced (but not below zero) by such capital gain excess, (ii) the taxpayer’s qualified dividend income shall be reduced by so much of such capital gain excess as exceeds the taxpayer’s net capital gain (determined without regard to section 1(h)(11) and the reduction under clause (i)), and (iii) adjusted net capital gain, unrecaptured section 1250 gain, and 28-percent rate gain shall each be determined after increasing the amount described in section 1(h)(4)(B) by such capital gain excess. (B) Definitions Terms used in this paragraph which are also used in section 1(h) shall have the respective meanings given such terms by section 1(h). . (35) Section 962(a)(1) is amended— (A) by