You don't say whether you currently have the plugins/know how to implement passive states. So you're going to need Yanfly's Buffs & States Core and Auto Passive States.
There's also no such thing as speed that can be buffed, so I presume you mean agility - if you meant something else, please clarify.
Then you can check the pinned thread of MV script calls to find the one for adding a buff, and check the Buffs & States documentation to find the correct notetag.
In your passive state's notes, put:
Code:
<Custom Initiate Effect>
if (this.isDamage())
user.addBuff(6, x);
</Custom Initiate Effect>
where x is how many turns you want the buff to last.
For the guaranteed escape, copy the below into a text editor, save as a *.js and install as a plugin:
Code:
BattleManager.processEscape = function() {
$gameParty.performEscape();
SoundManager.playEscape();
var success = this._preemptive ? true : $gameParty.aliveMembers().some(actor => actor.isStateAffected(x)) ? true : (Math.random() < this._escapeRatio);
if (success) {
this.displayEscapeSuccessMessage();
this._escaped = true;
this.processAbort();
} else {
this.displayEscapeFailureMessage();
this._escapeRatio += 0.1;
$gameParty.clearActions();
this.startTurn();
}
return success;
};
where x is the ID of your passive state (no leading zeros).