How to limit battery charging to (say) 80%

I had the same issue, even with root privileges I couldn’t save changes to those files. The Raspberry Pi family uses a separate settings file for this purpose, called config.txt. I found some good information in Rex’s post at uConsole still often, unpredictably dying at 50% - #4 by Rex

Not sure if will do exactly what you want, but that’s a good place to start.