That should be pretty easy, you probably need just one variable:
Since the blessing is permanent untill you pray at another shine, all you need to do is alter the character's parameters via a normal event at the shrine; in this event the first thing you do is to check the value of said variable; at the beginning of the game it will be zero, because all variables - as we know - start at
0, and also because at the beginning of the game you haven't prayed at any shrine yet.
We make a mental scheme of which shrine equals to which variable value (example: Shrine of Attack = 1, Shrine of Defense = 2, and so on...)
At this ponint the player reaches the Attack shrine, and gets a +10 ATK (just trowing in a random number), the variable takes value "1".
The game progresses and the player now reaches the Defense shrine. He choses to pray at the defense shrine, the event will see that the variable equals 1, so this means that the player has previously visited the attack shrine, therefore the games removes the +10 ATK bonus to the player, then grants him a +10 DEF bonus (again, random value), and this time the value of the variable will be 2.
All and all, your event should look like this (assuming we are praying at the Attack Shrine:
Code:
Conditional Branch: If Variable [Shrine Visited] = 0
nothing happens
ELSE
If Variable [Shrine Visited] = 1
change stats -> Atk -10
ELSE
IF Variable [Shrine Visited] = 2
change stats -> Def - 10
ELSE
If Variable [Shrine Visited] = 3
change stats -> Max HP - 100
ELSE
(continue with all existing shrines)
END
change stats -> Atk + 10
Change Variable -> [Shrine Visited] = 1
and that's it. There's actually tons of ways to do it with eventing alone, this is an easy peasy method, but for example if you want the permanent buff to increase depending on the player's level, you may add a second variable to multiply the buff for the player's level and then increase Attack by that value... that depends on how you want this feature to work
