this section), divided by (B) the total number of such qualified residents of such State estimated by the Secretary to claim the credit allowed under subsection (a) for such year. . (c) Effective date The amendments made by this section shall apply to taxable years beginning after January 1, 2018. 212. New Roth HSA credit (a) In general Subpart C of part IV of subchapter A of chapter 1 of the Internal Revenue Code of 1986 is amended by inserting after section 36B the following new section: 36C. Roth HSA credit (a) In general In the case of a qualifying individual, there shall be allowed as a credit against the tax imposed by this subtitle for any taxable year, an amount equal to the Roth HSA credit amount of the individual for the taxable year. (b) Qualifying individual For purposes of this section, the term qualifying individual means, with respect to any month, any individual who for such month is a deposit qualifying resident (as defined in section 103(b)(2) of the Patient Freedom Act of 2017 ) of a State described in section 102(a)(2) of such Act that elects to have section 103(b) of such Act carried out by way of the credit determined under this section. (c) Roth HSA credit amount For purposes of this section, the term Roth HSA credit amount means, with respect to any taxable year, the sum of the Roth HSA deposit amounts determined under section 104 of the Patient Freedom Act of 2017 with respect to the individual for all months ending during the taxable year. (d) Special rules For purposes of this section— (1) Reconciliation of credit and advance credit (A) Excess advance payments If the advance payments to an individual for a taxable year under subsection (e) exceed the credit allowed by this section with respect to such individual for such taxable year, the tax imposed by this chapter for the taxable year shall be increased by the amount of such excess. (B) Advance payment shortfall If the credit allowed by this section (determined without regard to this subparagraph) with respect to an individual for a