As far as I remember you have to Erode after each change. TG have to regenerate the Heightfield.
I never tried to erode a specific area using the paint shader thus cannot answer this question.
Functions (blue nodes)...huhh...well...to understand them you have to have a
very good understanding of math. My math is not very advanced thus 1. never using them and 2. cannot really explain the subject to you.
I tried to understand functions several times but keep failing.
Wish you luck with these.