Laptop lagging when AC plugged in

Check power settings. You can set how your computer will perform under certain conditions. So you can have your laptop performing very poorly to save power when plugged in or vice versa, IMO someone has messed up with power settings. But there is always a good chance it is overheating when plugged in for some reason so it is cutting down to prevent dmg on cpu/gpu.