How to create a custom warning message before posting

This might be useful for anyone that stumbles across this post: https://meta.discourse.org/t/alerts-that-react-to-the-user/

The site text path is:
/admin/customize/site_texts/education.new-topic?locale=en

and the educate until posts setting is located at: /admin/site_settings/category/all_results?filter=educate%20until%20posts