Aerodactyl VSTAR retains the effect of its "Ancient Star" attack even if it goes to the Bench or becomes Active. If an effect like Path to the Peak stadium shuts off Abilities then Ancient Star is turned off, but if that effect goes away, the Ancient Star Ability returns. It will also count toward the number of Pokemon with an Ability in play.
Source: Lost Origin FAQ; TPCi Rules Team (2022-09-08)