Need some help with Game_Action

just this little snippet: 

#-------------------------------------------------------------------------- # * Evaluate Skill/Item (Target Specification) #-------------------------------------------------------------------------- def evaluate_item_with_target(target) target.result.clear target.make_damage_value(subject, item) if item.for_opponent? return target.result.hp_damage.to_f / [target.hp, 1].max else recovery = [-target.result.hp_damage, target.mhp - target.hp].min return recovery.to_f / target.mhp end endend  Here's what I'm looking for:

1. BOOST the return result for healing. I think it's this line: return recovery.to_f / target.mhp

But I'm not sure what ranges of numbers I'm looking at here... it looks like the recovery amount / max hp - so, it'll be a 2-decimal percentage type number? (ie: 0.24) ??

What I'm basically looking to do is to value healing over doing damage.

2. Put an IF..THEN in that same "else" segment where recovery == 0 (it's not a healing skill/effect) and allow me to put in my own code snippet. I'm just not sure what the value for "recovery" will be (I'm still shaky on ruby). Will it be a negative number? (I don't think so) Will it be the amount healed, capped by the target's maxhp? what's the .min doing there? 

THANKS in advance!
Hmm, and you can't add the REC SP-Param to the class or actor? REC will boost the healing ability.

class-feature-rec.png
I'm not looking to boost the amount healed... I'm looking to boost the AI's decision-making to favor healing skills over damaging skills... 
You're in the wrong spot then. Action Result deals with applying the result of an already taken action. AI decision making is somewhere else (where, I don't recall, I've only dealt with scripting things after the action was taken so far).
I'm pretty sure I'm in the right spot in Game_Action.

This EVALUATES the action and returns a value... which is later used to determine which action is taken... 
yes and no - yes, it evaluates a value, but you have no way to detect if this evaluation is for the decision or for effect. That means changing the value here will also change the amount of damage/healing that is really done (unless you're programming in a lot more to detect the evaluation, and for that you'll need to change the original call to this method.

Depending on what exactly you want it's usually better not to change the scripts, but work with the attack patterns (ratings and conditions).
Ahh.. ok, I don't want to be doing that!

Unfortunately, I can't use attack patterns as this is mainly for the player's party (they are set to autobattle).

I don't want/need a full AI script and Craze's "Smart Heal" doesn't seem to be doing the trick. 

All I really need is a simple way to A) tell the AI to favor healing more favorably and 😎 tweak the decision making on non-healing and non-damaging skills (to ensue the AI actually uses them).
There is one script that sets an actor's autobattle to use a preset enemies attack pattern. Unfortunately I don't remember its name - I saw it when I checked through every script on the master script list one or two years ago. That took me several weeks then and I have only bookmarked the scripts I had more interests in.

That might be a better solution for you if you search for that one...
I investigated, the enemy actions are set under the Game_Enemy class. It appears the command is def select_enemy_action (I think?). I've avoided messing with that def so far as it is beyond my (weak) scripting skills.
 
In the past, I used Yanfly's Skill Restrictions script on enemy specific healing and raising skills.

<restrict eval>gtdm = $game_troop.dead_members.size;return false if gtdm > 0;return true;</restrict eval>The above code was used for the Raise skill of a 'puppet master' enemy, of sorts. In his skill list was a special Raise which was set to a priority of 10, but he couldn't actually use the skill unless one or more members of his party were dead. Perhaps you could use something like that.Also, have you tried setting the action patterns within each enemy?

enemy-feature-heal-skill.png
The above basically tells the enemy to focus on healing only when below 50% HP.
Yeah, I was looking for a way to do it without resorting to the Enemy patterns or an AI script (I did research the one that let actors use enemy attack patterns). 

Since I have thousands of skills (some of them from equipment), that's just not a viable option... 
Hmm... Maybe it's my scripts (which don't do anything special for combat except spit out the log) or maybe Andar is wrong... I just did this:

#-------------------------------------------------------------------------- # * Evaluate Skill/Item (Target Specification) #-------------------------------------------------------------------------- def evaluate_item_with_target(target) target.result.clear target.make_damage_value(subject, item) return 5000=begin if item.for_opponent? return target.result.hp_damage.to_f / [target.hp, 1].max else recovery = [-target.result.hp_damage, target.mhp - target.hp].min return recovery.to_f / target.mhp end=end endend And, if Andar is right, my damage values would have been 5000? 

They weren't. They were normal values I saw before adding that in.

I think -with all my tinkering- that the VALUE returned is a floater between 0.0 and 1.0. (assuming a 'naked' rand will return a number from 0.0 to 1.0)

So, if someone can confirm that, I can probably figure out the rest.

Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/need-some-help-with-game_action.41957/