How to undo the achievement of a goal? I have 2 goals on my website: 'Published 1 article' and 'Published 2 articles'. I have according rules that record the tasks for these goals when new content is published by a user.

Now, assume that a user published exactly 2 articles. That means he/she completed 'Published 2 articles'. How can I undo this goal (programmatically) when one of his/her articles are removed?

PS: I've already found this post, but as there aren't any answers, it wasn't that helpful... :)
Unfortunately, this isn't possible yet. A request has been made here. Hopefully, the maintainers will provide this feature in the future.

If someone gives a working solution later on, I'll mark it as answer instead.