1) The resethealth function called in all NPC scripts for restoring hitpoints after combat only restores their hitpoints to getbaseav health. As such, the Hit Points Cassidy gets from Calm Heart, or Rex gets from the new brain install are never restored once those 'extra' hitpoints are lost in combat.
2) The companion wheel only reports the getbaseav hitpoints as well. Thus, if you want to hit Rex or Cassidy with a Stim when they take damage, you are unable to do so until their hitpoints drop below their base value which does not include the extra hitpoints. Once they drop below their base, you can only stimpak them back to their base and no higher.