Hello everyone,
My question is in the title, but for more detail on its exact use : 

I'd like to add [/] or [%] to a parent heading in case I either add a TODO subheading or a checkbox. I don't want to type it in the parent heading, but add it automatically. Also, if all subheadings/checkboxes are removed, the statistics cookie should be removed from the parent heading automatically.

Question largely inspired by this one (which has not been answered):
https://www.reddit.com/r/emacs/comments/g2arww/how_to_adddelete_statistics_cookie_automatically/

Maybe this question is answered quite simply by having a correct level in Lisp, but I still have a lot of trouble with this language. If someone could help me, it would help me a lot ^^.

Thanks in advance for your future answers.