Was it a genuine OEM part it was replaced with? If it was one of these cheap copies that use cheap cells then that will be why the second one died so much quicker.
Also yes leaving a laptop permanently plugged in and full charged does not do it any good. Some laptop have a feature where you can cap the charge at 60%-80% if the laptop is going to be always plugged in.