How changing hero stats works
First, some background. Each stat has a current value, a maximum value, and a base value. The maximum value is always equal to the base value plus equipment bonuses, and then with stat caps applied. (Stat caps are set in the General Game Settings -> Battle System Options -> Stat Caps menu.) Base stats are never capped, and they aren't visible in-game anywhere. Modifying a stat's maximum in any way modifies its base value by the same amount, and vice-versa, but stat caps are preserved.
For example, suppose you define a hero Joe who has 20 ATK at level 0, and his default weapon is SoftTwig which gives -10 ATK. Suppose ATK is capped at 99. When you add Joe to the party at level 0, his ATK stats will be:
Base ATK: 20 Max ATK: 10 Current ATK: 10
If you use one of the methods below to give him a permanent +100 boost to Base ATK, his ATK stats are:
Base ATK: 120 Max ATK: 99 Current ATK: 99
During battles, all attacks modify the current value of all stats. There's no way to modify maximums. Now to explain how the engine handles the HP and MP stats differently to the others.
After each battle, changes to the current values of all stats other than HP and MP are discarded. You can't make changes to any other stats which persist after the end of battle.
If an item (attack) used outside of battle changes the HP or MP of a hero, then it affects the current value. If it targets a stat other than HP or MP, then it modifies both the current and maximum values (to be exact, it modifies the current, and then sets the maximum to the current... unless the "Don't reset max stats after OOB attack" general bitset is enabled), and the attack always acts as if the allow cure to exceed maximum bitset is on.
Increasing the maximum of a stat other HP or MP (outside battle only)
Doing this with a healing item should now be clear. Create a new attack with target stat as HP or MP, cure instead of harm turned on, and target "Ally". Attach this attack to an item as its When used outside of battle action. The "Don't reset max stats after OOB attack" general bitset also needs to be disabled for this to work properly (otherwise the change would be temporary instead).
If you want, you can use a script instead; see the next section. Those scripts can also be used for stats other than HP and MP.
Increasing maximum HP or MP (outside battle only)
If you want to change the maximum value of HP or MP you must use a script. See the Plotscripting Tutorial for details on writing and compiling scripts. You can attach a script to an item by creating a new textbox, and in the Conditionals submenu, set "run <script> instead" (Always). Then set the textbox as the out-of-battle effect of the item. The textbox won't display.
If you want to target a specific hero instead of letting the player choose, modify this script:
plotscript, add ten max HP, begin variable(who) who := find hero (hero:Bob) gain hero stat(who, stat:HP, 10) end
If you want to reset the current HP to the new maximum, change the last line to:
gain hero stat(who, stat:HP, 10, true)
Otherwise, by default the command will change the current value so that it's the same percentage of the max before and after. For example, 8/10 HP become 12/15 HP.
You can use the pick hero command to imitate the hero picker you normally see when using a healing item:
plotscript, add ten max HP, begin variable(who) who := pick hero if (who == -1) then (exit script) # player cancelled gain hero stat(who, stat:HP, 10) end
Unimportant extra comments
If you want to use "set hero stat" instead of "gain hero stat" you should normally modify the base stat, for example:
variable(old stat) old stat := get hero stat(who, stat:HP, base stat) set hero stat(who, stat:HP, old stat + 10, base stat)
This modifies the base stat instead of the maximum stat so that it works correctly with stat caps, but it will still work in most cases if you replace "base stat" with "maximum stat". To continue the example above, if you added Joe at level 0 to the party and ran
who := find hero (hero:Joe) old stat := get hero stat(who, stat:HP, maximum stat) set hero stat(who, stat:HP, oldstat + 100, maximum stat)
you would end up with
Base ATK: 120 Max ATK: 110 Current ATK: 10
and at the next opportunity (such as after the next battle) the Max ATK will be capped down to 99.