The line you're using is invalid since parameter(1) is actually a function and not a variable.
Use :
set string <weapon; $parameter(1)$>
msg <#(weapon):DamageMax#>
Instead.
I'd also say, instead of type "sword", that property would be generic across all 'weapons' (swords, axes, knives).