Once the battery is charged there is no more load based on it. So there is nil battery harm keeping phone connected to power. But if you disconnect power, the battery is discharging and then suffers a small amount of wear then being recharged.
So if you are near power, and don’t use it, you accelerate battery aging.