My main problem is that I understand Java, just not applying it to Minecraft.
I want to have it so every now and then, an apple or two will form similarly to the berries of the tree pictured below (this tree is from the Pokecube mod). While you can try to pick them immediately (via RMB), you have increasingly lower chances to get an apple than if you were to wait. It's that setup that I feel like I'm going to struggle with.
The tree itself, notice the berries hanging from it?:
Right-clicking one of these berries would drop one. This is mostly what I'm trying to replicate with the exception being that my apple trees would have 3 growth stages with chances of getting an apple increasing each stage (0% for the 1st stage, 50% for the 2nd, 100% 3rd). It would (similarly to this tree) also grow similarly to a crop until it finishes growing (at which point, it becomes a tree).