To amend the Internal Revenue Code of 1986 to improve health savings accounts, and for other purposes.

SECTION 1. SHORT TITLE, ETC.

    (a) Short Title.--This Act may be cited as the ``Health Savings 
Accounts Improvements Act of 2012''.
    (b) Table of Contents.--The table of contents for this Act is as 
follows:

Sec. 1. Short title, etc.
Sec. 2. Saver's credit for contributions to health savings accounts.
Sec. 3. Special rule for certain medical expenses incurred before 
                            establishment of account.
Sec. 4. Allow both spouses to make catch-up contributions to the same 
                            health savings account.
Sec. 5. Individuals eligible for veterans benefits for a service-
                            connected disability.
Sec. 6. Distributions by certain early retirees for health coverage 
                            treated as qualified medical expense.

SEC. 2. SAVER'S CREDIT FOR CONTRIBUTIONS TO HEALTH SAVINGS ACCOUNTS.

    (a) Allowance of Credit.--Subsection (a) of section 25B of the 
Internal Revenue Code of 1986 is amended by inserting ``aggregate 
qualified HSA contributions and'' after ``so much of the''.
    (b) Qualified HSA Contributions.--Subsection (d) of section 25B of 
such Code is amended by redesignating paragraph (2) as paragraph (3) 
and by inserting after paragraph (1) the following new paragraph:
            ``(2) Qualified hsa contributions.--The term `qualified HSA 
        contribution' means, with respect to any taxable year, any 
        contribution to a health savings account (as defined in section 
        223(d)(1)) if--
                    ``(A) such contribution is allowable as a deduction 
                to the taxpayer under section 223(a) for such taxable 
                year, or
                    ``(B) such contribution is made by an employer of 
                the taxpayer at the election of the taxpayer under a 
                cafeteria plan (as defined in section 125(d)) and is 
                not includible in the gross income of the taxpayer by 
                reason of section 125.''.
    (c) Reporting of HSA Elective Contributions.--Paragraph (12) of 
section 6051(a) of such Code is amended to read as follows:
            ``(12) the total amount contributed to health savings 
        accounts (as defined in section 223(d)) of the employee or the 
        employee's spouse and the portion of such total amount 
        contributed at the election of the employee under any cafeteria 
        plan (as defined in section 125(d)),''.
    (d) Conforming Amendments.--Section 25B(d)(3) of such Code, as 
redesignated by subsection (b), is amended--
            (1) by striking the first sentence of subparagraph (A) and 
        inserting the following: ``The aggregate qualified retirement 
        savings contributions determined under paragraph (1) and 
        qualified HSA contributions determined under paragraph (2) 
        shall be reduced (but not below zero) by the aggregate 
        distributions received by the individual during the testing 
        period from any entity of a type to which contributions under 
        paragraph (1) or paragraph (2) (as the case may be) may be 
        made.'', and
            (2) by inserting ``223(f)(1) or (3),'' after ``section 
        72(p),'' in subparagraph (C)(i).
    (e) Effective Date.--The amendments made by this section shall 
apply to taxable years beginning after December 31, 2012.

SEC. 3. SPECIAL RULE FOR CERTAIN MEDICAL EXPENSES INCURRED BEFORE 
              ESTABLISHMENT OF ACCOUNT.

    (a) In General.--Paragraph (2) of section 223(d) of the Internal 
Revenue Code of 1986 is amended by adding at the end the following new 
subparagraph:
                    ``(D) Treatment of certain medical expenses 
                incurred before establishment of account.--If a health 
                savings account is established during the 60-day period 
                beginning on the date that coverage of the account 
                beneficiary under a high deductible health plan begins, 
                then, solely for purposes of determining whether an 
                amount paid is used for a qualified medical expense, 
                such account shall be treated as having been 
                established on the date that such coverage begins.''.
    (b) Effective Date.--The amendment made by this section shall apply 
with respect to coverage beginning after the date of the enactment of 
this Act.

SEC. 4. ALLOW BOTH SPOUSES TO MAKE CATCH-UP CONTRIBUTIONS TO THE SAME 
              HEALTH SAVINGS ACCOUNT.

    (a) In General.--Paragraph (5) of section 223(b) of the Internal 
Revenue Code of 1986 is amended to read as follows:
            ``(5) Special rule for married individuals with family 
        coverage.--
                    ``(A) In general.--In the case of individuals who 
                are married to each other, if both spouses are eligible 
                individuals and either spouse has family coverage under 
                a high deductible health plan as of the first day of 
                any month--
                            ``(i) the limitation under paragraph (1) 
                        shall be applied by not taking into account any 
                        other high deductible health plan coverage of 
                        either spouse (and if such spouses both have 
                        family coverage under separate high deductible 
                        health plans, only one such coverage shall be 
                        taken into account),
                            ``(ii) such limitation (after application 
                        of clause (i)) shall be reduced by the 
                        aggregate amount paid to Archer MSAs of such 
                        spouses for the taxable year, and
                            ``(iii) such limitation (after application 
                        of clauses (i) and (ii)) shall be divided 
                        equally between such spouses unless they agree 
                        on a different division.
                    ``(B) Treatment of additional contribution 
                amounts.--If both spouses referred to in subparagraph 
                (A) have attained age 55 before the close of the 
                taxable year, the limitation referred to in 
                subparagraph (A)(iii) which is subject to division 
                between the spouses shall include the additional 
                contribution amounts determined under paragraph (3) for 
                both spouses. In any other case, any additional 
                contribution amount determined under paragraph (3) 
                shall not be taken into account under subparagraph 
                (A)(iii) and shall not be subject to division between 
                the spouses.''.
    (b) Effective Date.--The amendment made by this section shall apply 
to taxable years beginning after December 31, 2012.

SEC. 5. INDIVIDUALS ELIGIBLE FOR VETERANS BENEFITS FOR A SERVICE-
              CONNECTED DISABILITY.

    (a) In General.--Paragraph (1) of section 223(c) of the Internal 
Revenue Code of 1986 is amended by adding at the end the following new 
subparagraph:
                    ``(C) Special rule for individuals eligible for 
                certain veterans benefits.--An individual shall not 
                fail to be treated as an eligible individual for any 
                period merely because the individual receives hospital 
                care or medical services under any law administered by 
                the Secretary of Veterans Affairs for a service-
                connected disability (within the meaning of section 
                101(16) of title 38, United States Code).''.
    (b) Effective Date.--The amendment made by this section shall apply 
to months beginning after December 31, 2012.

SEC. 6. DISTRIBUTIONS BY CERTAIN EARLY RETIREES FOR HEALTH COVERAGE 
              TREATED AS QUALIFIED MEDICAL EXPENSE.

    (a) In General.--Subparagraph (C) of section 223(d)(2) of the 
Internal Revenue Code of 1986 is amended by striking ``or'' at the end 
of clause (iii), by striking the period at the end of clause (iv) and 
inserting ``, or'', and by adding at the end the following new clause:
                            ``(v) in the case of an account beneficiary 
                        who has attained age 55 but not the age 
                        specified in section 1811 of the Social 
                        Security Act, any group health plan (as defined 
                        in section 5000(b)(1)) in which such account 
                        beneficiary is enrolled by reason of being a 
                        former employee or a surviving spouse of a 
                        former employee.''.
    (b) Effective Date.--The amendments made by this section shall 
apply to amounts paid for coverage for periods after December 31, 2012.

Summary: Health Savings Accounts Improvements Act of 2012 - Amends the Internal Revenue Code, with respect to health savings accounts (HSAs), to: (1) allow a tax credit for retirement savings contributions for deductible contributions made to an HSA and salary reduction contributions under a cafeteria plan made by an employer to an HSA; (2) provide a special rule to allow a tax deduction for medical expenses incurred before the establishment of an HSA; (3) allow a husband and wife to make catch-up contributions to the same HSA; (4) allow veterans who receive medical benefits for a service-connected disability to participate in an HSA; and (5) allow HSA participants who are enrolled in a group health plan as a former employee or spouse of a former employee and who have attained age 55, but not age 65, to pay expenses for coverage under such plan from an HSA.