Large fossil fuel companies will have to pay fees to help New York fight the effects of climate change under new legislation.