The examples do not really help.
As there are so many methods to modify data, it depends a lot on the data structure.
E.g. if you simply want to replace "This is" with "was", then use an action of the type "Replace".
If you want to cut the data to a certain length, regardless of the contents, then an action of the type "Format value" with a string function like $left(%title%,15) might be enough.
Where / in which context did you try the $replace() statements?
You would have to use an action of the type "Format value" for TITLE (or the Convert>Tag-Tag function).
The first parameter of the $replace() statement is the source string, not the target.
So, I am sure that
$replace(%artist% - %album% - %track% - %title%,_,-)
has worked - only that there was no target specified where to put the result.
Also, it is not necessary to use the scripting functions as there are at least 2 Replace-actions that guide you through the parameters.