Try to completely discharge your computer: remove the battery, hold down the power button for 10 seconds, and reinsert the battery.
If that doesn't work, run HP's power adapter troubleshooting tool at [link|https://support.hp.com/id-en/help/diagnostics?category=computing&issue=battery-adapter-issues|https://support.hp.com/id-en/help/diagnostics?category=computing&issue=battery-adapter-issues|new_window=true]
Third, try a factory data reset to remove any faulty drivers or software that could be causing the glitches.