If you can prove that the property is subject to substantial dilapidations which violate local ordinance or state law, then you could sue the landlord for the "diminished value" of the tenancy. Your damages
would be the difference between the value of the rental property
in tenantable/legal condition and the value of the property in its actual condition.
If you have not contacted the local code enforcement officer to have the property inspected, you may want to do this, even if you are moving, because the inspector's citation of the landlord or testimony in court would be extremely credible proof of your claim of diminished value. If you cannot get the code enforcement officer's help, you could hire a local licensed contractor
to examine the property and provide you with a report of everything that appears to violate code -- or which violates the reasonable expectations of your rental agreement
(including any repairs that you may have requested which were never done). Then you would have a real estate
broker give you an opinion of the value of the rental in its current condition and the value in repaired condition.
If the reports of both these professionals and/or code enforcement are favorable, then you can sue the landlord for diminished value.
You would likely have to limit your damages to $10,000, because that is the limit of small claims court, where you could sue without hiring a lawyer. Also, you cannot go back more than four years because of the statute of limitations on a written contract.
But, four years is probably a fair amount of rent, so assuming you are willing to do the work in gathering the necessary evidence, you may be able to recover some of your rent.
Please let me know if I can be of further assistance.