Glad I could help.
Just wanted to say, I only used the numbers above for readability. In all cases, you can replace 100 with pMaxHP, 20 with potionAmount and 80 with (pMaxHP - potionAmount). So, the first option could read:
...The first triggers if the health value is below or equal to (pMaxHP - potionAmount) and simply adds the potion and health values. The other triggers if the health value is above (pMaxHP - potionAmount) and simply sets health to pMaxHP.
As I mentioned in my first post, the last option is more compact but requires an understanding of the min function and for those who don't know how it works, it may make it more difficult to upkeep. However, for those users reading this post who would like to understand the third option min(<health> + <potionAmount>, 100), here is a breakdown of what is going on:
min() -> This is a function built into Construct that takes a list of numbers separated by a comma and returns the lowest lumber in the list. There is also a function called max() which takes a comma separated list as well but returns the highest number in the list.
Inside the parens, I have 3 values:
<health> -> the current player health value
<potionAmount> -> the value to be added to health when a player drinks a potion
100 (aka <pMaxHp>) -> This is the max health value the potion is allowed to raise the players health to.
The first 2 variables are added together in the function. The min then evaluates to see if <health> + <potionAmount> is lower than 100. If it is lower, the sum <health> + <potionAmount> is returned. If not, 100 is returned.