I'm trying to implement the idea that was suggested in this edit.

I see how I can find the existing {{DYK-Tools-Bot was here}}, with Page.templatesWithParams().  But once I've got that, how do I actually change the parameters in the wikitext?