How can i base a point on a plan?

Yes, I know that. but I would like to do this in the script, as I will change the plan every cycle, and the only way I have found to create a plan every time is within a script.