(a) No action for the recovery of any lands or for the possession thereof against any person, or his or her heirs or assigns, who may hold such lands by virtue of a purchase thereof at a sale by the collector or Commissioner of State Lands, for the nonpayment of taxes, or who may have purchased them from the state by virtue of any act providing for the sale of lands forfeited to the state or the nonpayment of taxes, or who may hold the land under a donation deed from the state, shall be maintained unless it appears that the plaintiff, his or her ancestors, predecessors, or grantors were seized or possessed of the lands in question within two (2) years next before the commencement of the action.
(b) This section shall not apply to lands which have been sold to any improvement district of any kind or character for taxes due the districts nor to any taxes due any improvement districts, but the lien of the taxes shall continue until paid.
(c) The person, or his or her heirs or assigns, claiming any land mentioned in subsection (a) of this section shall, before the issuing of any writ, file in the office of the clerk of the proper court an affidavit setting forth that the claimant has tendered to the purchaser or purchasers thereof, or his or her agent or legal representative, the full amount of all taxes and costs first paid on account of the lands, with interest thereon at the rate of one hundred percent (100%) upon the amount first paid for the lands and twenty-five percent (25%) upon all costs and taxes paid upon the land thereafter, from the time the costs and taxes were paid, and also the full value of all improvements of whatever kind and description made on the lands, by the purchaser or purchasers, his or her heirs or assigns, or tenants, and that it has been refused.
(d) If any action shall be brought in any court of record in this state against any purchaser, or his or her heirs or assigns, holding any lands as specified in subsection (a) of this section, and it shall appear to the satisfaction of the court that no affidavit, as required in subsection (c) of this section, was filed previous to the commencement thereof, it shall be the duty of the court to dismiss the action at the cost of the plaintiff.
(e) If judgment shall be given against any purchaser, or his or her heirs or assigns who hold any lands as provided for in subsection (a) of this section in favor of any person claiming them, no matter by what manner of title, the judgment shall only be for the possession of the premises in question, and damages shall be assessed in favor of the defendant for the full amount of all taxes, costs, and interest provided for in subsection (c) of this section, together with the full value of all improvements of whatever kind and description made thereon, for which judgment shall be entered in favor of the defendant, and it shall be a lien upon the lands until satisfied.