See if this makes a difference:
$modx->makeUrl($modx->resource->get('id'), "", "", "full");
Is your plugin attached to OnWebPagePrerender?
If that doesn't work, you can always put this at the top of the page in your template:
Then do this in your plugin:
if($modx->resource->get('id') !=$modx->config['site_start']) //not on Startpage
{
$newOutput=str_replace('href="#', 'href="' .$modx->makeUrl($modx->resource->get('id'), "", "", "full") .'#top', $modx->resource->_output);
$newOutput=str_replace('/#', '#top', $newOutput); //if the page is a folder!!!
$modx->resource->_output = $newOutput;
}