Sadness, this was not as easy as I'd hoped. On the final trigger of Each Attack, the enemy dies and all of the enemy stat variables get set to zero before the script has a chance to execute. However, the sword also acts like a global character, so you can store the defence value at the start of the fight and then apply it later.
As far as I can tell, the following script, to replace the default script of the Mimic Blade character, works fine for the hold:
Set var "_MyATK" = 0
Set var "_MySword" = 7
Each attack Activate
Label Monitor
If ...
Wait for event Monster engaged
Set var "MBladeCache" = _EnemyDEF
If End
Wait 0
Go to Monitor
Label Activate
If ...
Wait until var "_EnemyHP" < 1
Set var "_MyATK" = MBladeCache
Set var "KillCount" + 1
If End
Go to Monitor
A couple of points to note:
1) The sword correctly handles enemies that you can get into a fight with but not hurt, like roach eggs, whereby its attack value does not change.
2) The sword cannot correctly handle multiple enemies being fought at the same time, as the defense valued gets stored is only for the first enemy, however there are no mimics in Washed Ashore so this doesn't matter.
3) The sword will reset to an attack of zero if you drop it and pick it up again later, however there are no other weapons in Washed Ashore so this will never happen.
4) Wait for Event Monster Stabbed is of no use because it only triggers on the turn AFTER you fight the enemy, so changing the attack of the blade is delayed, and by the time it fires _EnemyDEF has been reset to zero anyway.
EDIT: Well OK, there is one tiny difference here. If you attack a roach egg you cannot kill, when you press the special command so that Tendry tells you the defense value of the last enemy killed, he will report the roach egg's defense value. This has no meaningful gameplay effect though. In the above code I didn't want to only update MBladeCache if your total attack is higher than the enemy defense because then it doesn't work if you've used an invisibility potion and killed an enemy with higher defense than your total attack.
[Last edited by kieranmillar at 01-19-2016 09:08 PM]