Turning off Pharmacology?

Is there a way (plugin, script, etc) to have items used from the menu ignore PHA and only use 100% of an item's value?

I don't know enough to make my own solution, but I did perform due diligence and found this within RPG_Scenes:

JavaScript:
Scene_Item.prototype.user = function() {
    var members = $gameParty.movableMembers();
    var bestActor = members[0];
    var bestPha = 0;
    for (var i = 0; i < members.length; i++) {
        if (members[i].pha > bestPha) {
            bestPha = members[i].pha;
            bestActor = members[i];
        }
    }
    return bestActor;
};

But I'm too scared of permanently Breaking something to change this! Can a fella get some guidance? I still want the PHA to be in effect in battle, just not from the main menu.
divide the item's healing by a.pha

EDIT: your edit loaded. you can make any changes to the engine safely without changing the game's core js files (you shouldnt do that anyways). If you want to toy around with that function, take that snippet, make your modifications, save it as a .js file, and reintroduce it to the game as a plugin. if it doesnt work, you just remove/change the plugin.
divide the item's healing by a.pha
Wouldn't this mess up the healing for the characters that don't have a PHA boost?

EX: I'm looking for a 100hp potion to restore 100 when used by sam, 150 when used by Bill, and 100 when used on the menu. If I divide the item's healing by a.pha, then wouldn't sam only get 50 points of healing?
Wouldn't this mess up the healing for the characters that don't have a PHA boost?
by default, an actor's pha is 1, so not having a pha boost wont have an impact.
the only time the suggestion may go bad is if you have a state that reduces pha to 0%

EDIT: oh, i get it now. it should be affected by pha while in battle, but not while outside. i missed that in the edit. without making changes to the function, you could have the formula be:
$gameParty.inBattle() ? 100 : 100/a.pha
Take that snippet in the OP and change it to:

Scene_Item.prototype.user = function() {
var members = $gameParty.movableMembers();
var bestActor = members[0];
return bestActor;
};

It works! Thanks to all for the help!
It works! Thanks to all for the help!
That code does not do what you said you want.

That will use the pharmacology of the first actor in your party who isn't petrified, regardless of what it is. The pharmacology rating will still apply.

Causing pharmacology to not apply in specific situations (e.g. out of battle) has nothing to do with that function - did a person write that code for you?
That code does not do what you said you want.

That will use the pharmacology of the first actor in your party who isn't petrified, regardless of what it is. The pharmacology rating will still apply.

Causing pharmacology to not apply in specific situations (e.g. out of battle) has nothing to do with that function - did a person write that code for you?

me, I guess. I just deleted everything that had anything to do with PHA in the coding. Any suggestions on how to get it to do what I'm looking for?
me, I guess. I just deleted everything that had anything to do with PHA in the coding.
So, my personal tip: if you don't know what you're doing with computer code, guessing will have a failure rate asymptotically close to 100% 😛

Paste this into a text editor, save as a *.js file, include as a plugin. It will cause pharmacology to be ignored when items are used outside of battle.

Code:
Game_Action.prototype.itemEffectRecoverHp = function(target, effect) {
    var value = (target.mhp * effect.value1 + effect.value2) * target.rec;
    if (this.isItem() && $gameParty.inBattle()) {
        value *= this.subject().pha;
    }
    value = Math.floor(value);
    if (value !== 0) {
        target.gainHp(value);
        this.makeSuccess(target);
    }
};

Game_Action.prototype.itemEffectRecoverMp = function(target, effect) {
    var value = (target.mmp * effect.value1 + effect.value2) * target.rec;
    if (this.isItem()&& $gameParty.inBattle()) {
        value *= this.subject().pha;
    }
    value = Math.floor(value);
    if (value !== 0) {
        target.gainMp(value);
        this.makeSuccess(target);
    }
};

Good luck with your project!
So, my personal tip: if you don't know what you're doing with computer code, guessing will have a failure rate asymptotically close to 100% 😛

Paste this into a text editor, save as a *.js file, include as a plugin. It will cause pharmacology to be ignored when items are used outside of battle.

Code:
Game_Action.prototype.itemEffectRecoverHp = function(target, effect) {
    var value = (target.mhp * effect.value1 + effect.value2) * target.rec;
    if (this.isItem() && $gameParty.inBattle()) {
        value *= this.subject().pha;
    }
    value = Math.floor(value);
    if (value !== 0) {
        target.gainHp(value);
        this.makeSuccess(target);
    }
};

Game_Action.prototype.itemEffectRecoverMp = function(target, effect) {
    var value = (target.mmp * effect.value1 + effect.value2) * target.rec;
    if (this.isItem()&& $gameParty.inBattle()) {
        value *= this.subject().pha;
    }
    value = Math.floor(value);
    if (value !== 0) {
        target.gainMp(value);
        this.makeSuccess(target);
    }
};

Good luck with your project!

Holy smokes thank you so much! Like you said, I don't know what I'm doing with code. Whenever you have a moment, can you break down your solution? It could help me try to understand how the stuff works behind the scenes =)
I strongly suggest if you're interested in it, actually learning it in a sequential order of knowledge/skills. I like the w3schools JavaScript tutorials, starting with the Statements chapter, but there are tons of options if you Google it.

The problem with your initial post is the function you copied has nothing to do with actually using the pharmacology parameter. The code includes ".pha", but it's not used for anything except determining which actor is chosen to have the best.

So I searched the contents of the js directory for ".pha" and clicked through the instances to find where it was used. The answer was clearly the functions I pasted above, where you can see value *= this.subject().pha - it's actually being used to modify a number.

Since you wanted it to only happen in battle, I added the check to the line above, if ($gameParty.inBattle())

But all of that is not really knowledge you can apply to some other situation if you're not able to understand what a line of code is doing when you read it, or how to look up RPG Maker's functions (like inBattle() ).

I hope all of that meant something 😛

Original thread: https://forums.rpgmakerweb.com/threads/turning-off-pharmacology.165228/