Ok guys I have found and fixed the problem.
Apparently, the plugin wasn't loaded before it was called and as a result it wasn't firing. To fix this simply put this line
$_PLUGINS->loadPluginGroup('user');
In the hack after declaring $_PLUGINS as global.
The hack therefore becomes
global $_PLUGINS;
$_PLUGINS->loadPluginGroup('user');
$_PLUGINS->trigger( 'onAfterUserProfileEditDisplay', array($user,true));
and
global $_PLUGINS;
$_PLUGINS->loadPluginGroup('user');
$_PLUGINS->trigger( 'onAfterRegisterUserDisplay', null);