Provide message if plugin is not available

Our product provides a Gradle plugin with it and we provide build.gradle files which apply this plugin. If the plugin isn’t available to Gradle, I want to provide a custom message to help the user as opposed to the default “Plugin with id ‘myplugin’ not found.” I’ve seen how you can get the applied plugins, but this isn’t what I want. If the plugin isn’t available to Gradle, it will never be applied.

How can I determine if a plugin is available to Gradle, and supply a custom message if it isn’t?