Warning , Use of undefined constant PLUGIN_PATH?

The error is self explanatory: PLUGIN_PATH is not defined anywhere.

It is not one of WordPress’ default constants (which are listed here, and all start with WP_). In the context of the code you’ve copied, it’s apparent that it was either supposed to be replaced with the path to your plugin (in which case using a constant in the example code was a bad idea), or it used to exist (the answer is 8 years old). This is mentioned in the comments on your own link.

To get the path to a plugin file (these days at least), you need to use plugin_dir_path():

if ( file_exists( plugin_dir_path( __FILE__ ) . 'Custom_File.php' ) ) {
    return plugin_dir_path( __FILE__ ) . 'Custom_File.php';
}

Just be aware that plugin_dir_path( __FILE__ ) returns the path to the current file, so if the file containing this code is in a subfolder of your plugin you need to account for that.

error code: 523