Damaged Dip Tube
The dip tube is a plastic pipe inside the water heater that delivers the cold water supply to the bottom of the tank, where heat is applied to it. The heated water is drawn from the top of the tank. If the tube is cracked, split or broken anywhere, the cold water might be mixing with the hot at the top, resulting in lukewarm water at the tap. A bad dip tube can be replaced; consult the heater's manufacturer.