Leaving mains electricity all the time will shorten a battery's life by making it lazy but it's a very slow process. If there will be times you need to depend on the battery, make a habit of keeping it running until it's close to shutting the machine down then fully charge it. Repeat that process to get long battery life.