Wow, it sounds like what we have here is a "Failure to Communicate".
You claim that you moved to a new unit to save money. Yet you describe the unit you agreed to move into as being an absolute wreck and uninhabitable. Why did you ever agree to take possession of the unit without the repairs already being made???
You claim that since the landlord didn't make the repairs, you have withheld your rent, further clouding your rights.
As I see it, based purely on YOUR version, you are both at fault.
Here is what the New York Attorney General says about some of the issues you have raised:
WARRANTY OF HABITABILITY
Tenants are entitled to a livable, safe and sanitary apartment. Lease provisions inconsistent with this right are illegal. Failure to provide heat or hot water on a regular basis, or to rid an apartment of insect infestation are examples of a violation of this warranty. Public areas of the building are also covered by the warranty of habitability. The warranty of habitability also applies to cooperative apartments, but not to condominiums. Any uninhabitable condition caused by the tenant or persons under his direction or control does not constitute a breach of the warranty of habitability. In such a case, it is the responsibility of the tenant to remedy the condition. (Real Property Law §235-b)
If a landlord breaches the warranty, the tenant may sue for a rent reduction. The tenant may also withhold rent, but in response, the landlord may sue the tenant for non-payment of rent. In such a case, the tenant may countersue for breach of the warranty. Rent reductions may be ordered if a court finds that the landlord violated the warranty of habitability. The reduction is computed by subtracting from the actual rent the estimated value of the apartment without the essential services.
A landlord's liability for damages is limited when the failure to provide services is the result of a union-wide building workers' strike. However, a court may award damages to a tenant equal to a share of the landlord's net savings because of the strike. Landlords will be liable for lack of services caused by a strike when they have not made a good faith attempt, where practicable, to provide services.
In emergencies, tenants may make necessary repairs and deduct reasonable repair costs from the rent. For example, when a landlord has been notified that a door lock is broken and willfully neglects to repair it, the tenant may hire a locksmith and deduct the cost from the rent. Tenants should keep receipts for such repairs.
LANDLORDS' DUTY OF REPAIR
Landlords of buildings with three or more apartments must keep the apartments and the buildings' public areas in "good repair" and clean and free of vermin, garbage or other offensive material. Landlords are required to maintain electrical, plumbing, sanitary, heating, ventilating systems and appliances landlords install, such as refrigerators and stoves in good and safe working order. Tenants should bring complaints to the attention of their local housing officials. (Multiple Dwelling Law (MDL) §78 and §80; Multiple Residence Law (MRL) §174. The MDL applies to cities with a population of 325,000 or more and the MRL applies to cities with less than 325,000 and to all towns and villages.)
LEAD PAINT
Landlords of apartments in multiple dwellings in New York City where a child 6 years old or younger lives must protect against the possibility that children will be poisoned by peeling of dangerous lead based paint. Landlords must remove or cover apartment walls and other areas where lead based paint is peeling. The law presumes that lead based paint was used in the apartment if the building was built prior to January 1, 1960. (NYC Health Code §173.14) Landlords must provide all tenants with a pamphlet prepared by the federal Environmental Protection Agency which warns the tenants of the hazards of lead based paint and a disclosure form advising what the landlord knows about the presence of lead based paint in the apartment and building.
RETALIATION
Landlords are prohibited from harassing or retaliating against tenants who exercise their rights. For example, landlords may not seek to evict tenants solely because tenants (a) make good faith complaints to a government agency about violations of any health or safety laws; or (b) take good faith actions to protect rights under their lease; or (c) participate in tenants' organizations. Tenants may collect damages from landlords who violate this law, which applies to all rentals except owner-occupied dwellings with fewer than four units. (Real Property Law §223-b)
Source:
http://www.oag.state.ny.us/realestate/habitability.html#13