I owned an Asus X405UQ which came with this Battery Health Charging app that controls the charging threshold. But since I only use Windows 10 for gaming, I've setup my working environment and install Ubuntu 18.04 dual booting on Windows 10. I plug my laptop whenever there is an AC power available and it stays plugged in when I'm working. I use the battery only if I work while on long trips, so I searched for a similar app for Linux. I've learned that the driver to make this work is vendor specific and that Asus has no driver support for Linux like Thinkpads does with TLP. (next time I'll be buying Thinkpads instead).
But I found out that booting to Windows and setting the charge threshold to i.e. 60% before rebooting to Ubuntu 18.04 (without powering off or shutting down) will persist the charge threshold. Even thought I disconnect the power adapter and allowed it to drain the battery, plugging it in again charges it up to 59% or 79% depending on the preset threshold (it is always 1 percent short than the indicated threshold level). It will only revert to original state (charges up to 100%) if I power off my laptop, unplug the adapter, power it on and boot to Ubuntu directly without going first to Windows or if I set it to 100% using the battery app in Windows.
I was happy with this setup since it is better than to have no threshold control at all. However, my laptop went back to the store for repair (intermittent wifi connection on 5GHz band) and when I received it (restored to original factory default, Ubuntu erased) and installed again Ubuntu 18.04 that feature no longer persist.
I've tried updating Ubuntu Kernels but to no avail. When I tried upgrading the BIOS, I've found out that the one installed version 305 at the time of this writing does not yet exist on Asus support page (some forums says Microsoft update is responsible for this) and the most recent was just 304. I've tried downloading WinFlash from Asus site but downgrading BIOS with the /nodate trick doesn't work.
The solution that worked for me:
Download Asus WinFlash 3.0.1 and install it. Do not use the latest version 3.2.5 or above as it no longer allows the /nodate option. I guess the most recent BIOS update addresses some of the spectre vulnerability and they do not want you to downgrade BIOS version but my battery life is much more important for me.
Downgrade to BIOS version 302. Your laptop model might be different so choose according to your laptop model. Unzip the BIOS file.
Type "WinFlash" on the start menu. Right click on the WinFlash icon and select "Open file location". This will open a Windows Explorer showing the start menu shortcuts. Right click on the WinFlash shortcut and select properties. On the leftmost end of the target path, after the double quotes, add a blank space then type in "/nodate" without the quotes. End result will look like this:
"C:\Program Files (x86)\ASUS\WinFlash\WinFlash.exe" /nodate
Run WinFlash using that modified shortcut and select the downloaded BIOS file. The Update button should not be grayed out anymore. Click Update and afterwards, it will ask you to reboot so it can flash the BIOS. Make sure you are plugged-in or your battery level is high.
The laptop will enter the BIOS screen and you will see a progress indicator. My laptop restarted twice during the process. I allowed it to boot to Windows first then I restarted it and enter my BIOS settings to disable secure boot (to allow my Ubuntu 18.04 to boot). At this point, if you had your threshold level lower than the battery current charge level, you should notice the led power indicator on your laptop turning white instead of amber indicating that the battery is not charging anymore. This should persist even though you had restarted your laptop before booting to Ubuntu